roger_style_guide 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f1552321c45c294600ff1ac9ede732cff4a7e8a2
4
- data.tar.gz: 50d9cba16e9184beaeb96c317c68aef15eb18d24
3
+ metadata.gz: 4defbadc1eb9d02c26c8e4b377ac3fa31800f166
4
+ data.tar.gz: 0f98815f6336aa23483ea610a4cb01021316ae72
5
5
  SHA512:
6
- metadata.gz: 5d79398e55a63c09c46a63109e1329ba34a61ceb91d29c835d13e97eb7c980cfe8388af411c6e455834236acfb204d0c1128dc08787911ac974707486feb4aad
7
- data.tar.gz: 10a568c43fd8c148b163f83beba24cd2b6950c60df83490d8ef367e4d4000c60b4cdcf2a3ab72e986e98c68c9a699d91a0f7b0e9409c645c9016f098f8db0a51
6
+ metadata.gz: 36139a5957fec35fb88adf4ff43796f31a5edb07c6d242daa77c8624f0fdb22c5ec933b21ebd69a2a7216286a1334a4f23b26125e82e4f458decde06fe79233a
7
+ data.tar.gz: 6f1a8c24f8aa21a24612e371e4c52817f05380b2511c518feb5dff23e301ae3dfc8faeff56d6c0740b819ab45bcc30e59f7633738dfcf8dd07966b66a5202bac
data/README.md CHANGED
@@ -11,17 +11,20 @@ Quick & easy component generation:
11
11
 
12
12
  `roger generate component NAME`
13
13
 
14
- will generate this structure in your components path:
14
+ will generate this structure in your components path by default:
15
15
  ```
16
16
  NAME.html.erb
17
17
  _NAME.html.erb
18
18
  _NAME.scss
19
19
  ```
20
20
 
21
+ If you have a `PROJECT_PATH/lib/component_template` directory it will use that. This makes it easier to use custom templates.
22
+
21
23
  Options for the command are:
22
24
 
23
25
  * `--js` : Will generate a `NAME.js` file too
24
26
  * `--extension=EXT` : Will generate a `_NAME.EXT` instead of `_NAME.html.erb`
27
+ * `--template_path=PATH` : The directory to use as template (uses `roger.project.path/lib/component_template` as default and if that doesn't exist it will use the internal template).
25
28
 
26
29
  #### Helper
27
30
  The `component` function is simplification of the `partial` function. Taking this directory structure:
@@ -11,6 +11,12 @@ module RogerStyleGuide::Generators
11
11
  desc: "Components path, default: roger.project.html_path/#{RogerStyleGuide.components_path}"
12
12
  )
13
13
 
14
+ class_option(
15
+ :template_path,
16
+ type: :string,
17
+ desc: "Template path, default: roger.project.path/lib/component_template"
18
+ )
19
+
14
20
  class_option(
15
21
  :js,
16
22
  type: :boolean,
@@ -25,7 +31,15 @@ module RogerStyleGuide::Generators
25
31
  default: "html.erb")
26
32
 
27
33
  def self.source_root
28
- File.dirname(__FILE__) + "/component/template"
34
+
35
+ end
36
+
37
+ def source_paths
38
+ if options[:template_path]
39
+ [options[:template_path]]
40
+ else
41
+ [project_template_path, File.dirname(__FILE__) + "/component/template"]
42
+ end
29
43
  end
30
44
 
31
45
  def do
@@ -50,6 +64,11 @@ module RogerStyleGuide::Generators
50
64
  Roger::Cli::Base.project &&
51
65
  Roger::Cli::Base.project.html_path + RogerStyleGuide.components_path
52
66
  end
67
+
68
+ def project_template_path
69
+ Roger::Cli::Base.project &&
70
+ Roger::Cli::Base.project.path + "lib/component_template"
71
+ end
53
72
  end
54
73
  end
55
74
 
@@ -1,4 +1,4 @@
1
1
  # RogerStyleGuide Version
2
2
  module RogerStyleGuide
3
- VERSION = "0.1.1"
3
+ VERSION = "0.2.0"
4
4
  end
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.1.1
4
+ version: 0.2.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: 2016-12-08 00:00:00.000000000 Z
11
+ date: 2016-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: roger