roger_style_guide 0.2.3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 391ad8b16edb54bf7fef64c0340b2833b35d5361ab0cf4212c24f0118528d783
|
4
|
+
data.tar.gz: 48e57651005592493e58c5fc2a5f643e2d6e3b5edf5c995f7eb1dc0db1ba77f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0371e3a200e3df73541ce325dcc310661d0e6b49c8a253d12bce47fdc568843352673491e2d8c6b90de7e8b68a2ea5f1d52ab4671039ab73384ff9b450a8d4dd
|
7
|
+
data.tar.gz: 1ec3933f761df9299d39b42fb7afccffc531a4b1e97e1d9ba358185097823b255c9d1e053acfc1504637915d7004b9acdda4f301c1d229114f94b76d251dd200
|
@@ -12,7 +12,7 @@ module RogerStyleGuide::Generators
|
|
12
12
|
class_option(
|
13
13
|
:components_path,
|
14
14
|
type: :string,
|
15
|
-
desc: "Components path, default: roger.project.html_path/#{RogerStyleGuide.
|
15
|
+
desc: "Components path, default: roger.project.html_path/#{RogerStyleGuide.components_paths[0]}"
|
16
16
|
)
|
17
17
|
|
18
18
|
class_option(
|
@@ -66,7 +66,7 @@ module RogerStyleGuide::Generators
|
|
66
66
|
def components_path
|
67
67
|
options[:components_path] && Pathname.new(options[:components_path]) ||
|
68
68
|
Roger::Cli::Base.project &&
|
69
|
-
Roger::Cli::Base.project.html_path + RogerStyleGuide.
|
69
|
+
Roger::Cli::Base.project.html_path + RogerStyleGuide.components_paths[0]
|
70
70
|
end
|
71
71
|
|
72
72
|
def project_template_path
|
@@ -26,17 +26,19 @@ module RogerStyleGuide::Helpers::ComponentHelper
|
|
26
26
|
extension = File.extname(name)[1..-1]
|
27
27
|
name_without_extension = extension ? name.sub(/\.#{Regexp.escape(extension)}\Z/, "") : name
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
29
|
+
dirs = RogerStyleGuide.components_paths.inject([]) do |dirs, components_path|
|
30
|
+
dir = File.join(
|
31
|
+
components_path,
|
32
|
+
path.slice(0, path.size - name.size).to_s.strip
|
33
|
+
)
|
33
34
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
35
|
+
dirs += [
|
36
|
+
# component_path/name/_name.xyz
|
37
|
+
File.join(dir, name_without_extension, local_name),
|
38
|
+
# component_path/name
|
39
|
+
File.join(dir, name)
|
40
|
+
]
|
41
|
+
end
|
40
42
|
end
|
41
43
|
end
|
42
44
|
|
data/lib/roger_style_guide.rb
CHANGED
@@ -3,12 +3,12 @@ require "pathname"
|
|
3
3
|
# Toplevel module for all things concerning RogerStyleGuide
|
4
4
|
module RogerStyleGuide
|
5
5
|
# The path within project.html_path where the components reside
|
6
|
-
def self.
|
7
|
-
@
|
6
|
+
def self.components_paths=(path)
|
7
|
+
@components_paths = [Pathname.new(path)]
|
8
8
|
end
|
9
9
|
|
10
|
-
def self.
|
11
|
-
@
|
10
|
+
def self.components_paths
|
11
|
+
@components_paths || ["components"]
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roger_style_guide
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Flurin Egger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-08-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: roger
|
@@ -185,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
185
185
|
version: '0'
|
186
186
|
requirements: []
|
187
187
|
rubyforge_project:
|
188
|
-
rubygems_version: 2.
|
188
|
+
rubygems_version: 2.7.7
|
189
189
|
signing_key:
|
190
190
|
specification_version: 4
|
191
191
|
summary: Styleguide plugin for Roger
|