netguru_bootstrapper 0.0.4 → 0.0.5

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.
Files changed (24) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/bin/netguru_bootstrapper +4 -0
  4. data/lib/netguru_bootstrapper/cli.rb +17 -0
  5. data/lib/netguru_bootstrapper/generator.rb +42 -0
  6. data/lib/netguru_bootstrapper/structure_parser.rb +1 -0
  7. data/lib/netguru_bootstrapper/{generators/templates → templates}/application.scss +0 -0
  8. data/lib/netguru_bootstrapper/templates/framework/_components.scss +53 -0
  9. data/lib/netguru_bootstrapper/{generators/templates → templates}/framework/_overrides.scss +0 -0
  10. data/lib/netguru_bootstrapper/{generators/templates → templates}/framework/_variables.scss +0 -0
  11. data/lib/netguru_bootstrapper/{generators/templates → templates}/settings/_breakpoint-variables.scss +0 -0
  12. data/lib/netguru_bootstrapper/{generators/templates → templates}/settings/_variables.scss +0 -0
  13. data/lib/netguru_bootstrapper/{generators/templates → templates}/settings/_z-index-variables.scss +0 -0
  14. data/lib/netguru_bootstrapper/{generators/templates → templates}/utilities/_functions.scss +0 -0
  15. data/lib/netguru_bootstrapper/{generators/templates → templates}/utilities/_mixins.scss +0 -0
  16. data/lib/netguru_bootstrapper/{generators/templates → templates}/utilities/_shared.scss +0 -0
  17. data/lib/netguru_bootstrapper/{generators/templates → templates}/utilities/_typography.scss +0 -0
  18. data/lib/netguru_bootstrapper/version.rb +1 -1
  19. data/lib/netguru_bootstrapper.rb +1 -1
  20. data/netguru_bootstrapper.gemspec +1 -0
  21. metadata +33 -17
  22. data/lib/netguru_bootstrapper/engine.rb +0 -7
  23. data/lib/netguru_bootstrapper/generators/netguru_bootstrapper/bootstrap_generator.rb +0 -41
  24. data/lib/netguru_bootstrapper/generators/templates/framework/_components.scss +0 -53
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ebd17af66e8c5925008d84a84cd9d560291d044f
4
- data.tar.gz: 737d44abb6396c8bb8148e6888b2a252a5077659
3
+ metadata.gz: 736dd9cbc3f8034f9c3554092707f780c34652ae
4
+ data.tar.gz: 91a345996c19ac91d2edb255552c2bb02e163761
5
5
  SHA512:
6
- metadata.gz: 786af7c34366ed4e2e082c3a5da3055003561d4bcd9dfbd0069f8c7cb7fa356b8b257c5065bd741467f6eb55b3aa73b2c59ffc2f2850414974f4085b5c8553a0
7
- data.tar.gz: da85d0166929debe1de40a9c9b9e927076178ee70e624c522850207347a57b22a18bb8b23a303aa11b94f4d35d06e03366a56815cd2ad3e76b06faa8f1ac4a62
6
+ metadata.gz: 4c4301a9dd582e2a4f0a9f717e1f69c89c19c1a2f7ed23e5c1451b18d45df2652aaa82410ff21ffcda21aa496c6adadad60d1570e5222fabe9c510bb58cb2d38
7
+ data.tar.gz: da262059c4f2e560636171651ee9d8c761245c5b5b192ed5d2348a48a833fd04c3fd1cea889f5ffaf8a30d6aa113a4c9c602a20b1bb377a01f9ba9fb7aa92253
data/README.md CHANGED
@@ -73,7 +73,7 @@ $font-size-base: 16px;
73
73
 
74
74
  #### <code>framework/_overrides.scss</code>
75
75
 
76
- Similar to Boostrap Components - all overrides are commented out by default. After uncommenting an override you need to add proper file to <code>settings/bootstrap-overrides</code> directory.
76
+ Similar to Boostrap Components - all overrides are commented out by default. After uncommenting an override you need to add proper file to <code>framework/overrides</code> directory.
77
77
 
78
78
 
79
79
  ## Contributing
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby -wU
2
+
3
+ require 'netguru_bootstrapper'
4
+ NetguruBootstrapper::Cli.start(ARGV)
@@ -0,0 +1,17 @@
1
+ require 'thor'
2
+ require_relative './generator'
3
+
4
+ module NetguruBootstrapper
5
+ class Cli < ::Thor
6
+ include Thor::Actions
7
+
8
+ desc "install", "Generate tree structure"
9
+ option :path
10
+ option :bootstrap_path
11
+
12
+ def install
13
+ say 'Generating tree structure...', :blue
14
+ Generator.start(ARGV)
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,42 @@
1
+ require 'thor'
2
+ require_relative './structure_parser'
3
+
4
+ module NetguruBootstrapper
5
+ class Generator < Thor::Group
6
+ include Thor::Actions
7
+
8
+ class_option :path, default: 'app/assets/stylesheets'
9
+ class_option :bootstrap_path, default: 'bootstrap'
10
+
11
+ def self.source_root
12
+ File.expand_path('../templates', __FILE__)
13
+ end
14
+
15
+ def create_root_file
16
+ say "Using #{options[:path]} as root directory", :blue
17
+ template 'application.scss', "#{options[:path]}/application.scss"
18
+ end
19
+
20
+ def create_directories
21
+ structure.directories.each do |dir|
22
+ empty_directory "#{options[:path]}/#{dir}"
23
+ create_files(dir, structure.files[dir])
24
+ end
25
+ end
26
+
27
+ private
28
+
29
+ def structure
30
+ StructureParser.new
31
+ end
32
+
33
+ def create_files(dir, files)
34
+ return create_file "#{options[:path]}/#{dir}/.gitkeep" if files.nil?
35
+ files.each { |file| copy_template(dir, file) }
36
+ end
37
+
38
+ def copy_template(dir, file)
39
+ template "#{dir}/#{file}.scss", "#{options[:path]}/#{dir}/#{file}.scss"
40
+ end
41
+ end
42
+ end
@@ -1,4 +1,5 @@
1
1
  require 'yaml'
2
+ require 'ostruct'
2
3
 
3
4
  module NetguruBootstrapper
4
5
  class StructureParser < OpenStruct
@@ -0,0 +1,53 @@
1
+ // Please do not change the order of these files. More more information see:
2
+ // https://github.com/twbs/bootstrap-sass/blob/master/assets/stylesheets/_bootstrap.scss
3
+
4
+ // Core variables and mixins
5
+ @import "<%= options[:bootstrap_path] %>/variables";
6
+ @import "<%= options[:bootstrap_path] %>/mixins";
7
+
8
+ // Reset and dependencies
9
+ @import "<%= options[:bootstrap_path] %>/normalize";
10
+ @import "<%= options[:bootstrap_path] %>/print";
11
+ @import "<%= options[:bootstrap_path] %>/glyphicons";
12
+
13
+ // Core CSS
14
+ @import "<%= options[:bootstrap_path] %>/scaffolding";
15
+ @import "<%= options[:bootstrap_path] %>/type";
16
+ @import "<%= options[:bootstrap_path] %>/code";
17
+ @import "<%= options[:bootstrap_path] %>/grid";
18
+ @import "<%= options[:bootstrap_path] %>/tables";
19
+ @import "<%= options[:bootstrap_path] %>/forms";
20
+ @import "<%= options[:bootstrap_path] %>/buttons";
21
+
22
+ // Components
23
+ @import "<%= options[:bootstrap_path] %>/component-animations";
24
+ @import "<%= options[:bootstrap_path] %>/dropdowns";
25
+ @import "<%= options[:bootstrap_path] %>/button-groups";
26
+ @import "<%= options[:bootstrap_path] %>/input-groups";
27
+ @import "<%= options[:bootstrap_path] %>/navs";
28
+ @import "<%= options[:bootstrap_path] %>/navbar";
29
+ @import "<%= options[:bootstrap_path] %>/breadcrumbs";
30
+ @import "<%= options[:bootstrap_path] %>/pagination";
31
+ @import "<%= options[:bootstrap_path] %>/pager";
32
+ @import "<%= options[:bootstrap_path] %>/labels";
33
+ @import "<%= options[:bootstrap_path] %>/badges";
34
+ @import "<%= options[:bootstrap_path] %>/jumbotron";
35
+ @import "<%= options[:bootstrap_path] %>/thumbnails";
36
+ @import "<%= options[:bootstrap_path] %>/alerts";
37
+ @import "<%= options[:bootstrap_path] %>/progress-bars";
38
+ @import "<%= options[:bootstrap_path] %>/media";
39
+ @import "<%= options[:bootstrap_path] %>/list-group";
40
+ @import "<%= options[:bootstrap_path] %>/panels";
41
+ @import "<%= options[:bootstrap_path] %>/responsive-embed";
42
+ @import "<%= options[:bootstrap_path] %>/wells";
43
+ @import "<%= options[:bootstrap_path] %>/close";
44
+
45
+ // Components w/ JavaScript
46
+ @import "<%= options[:bootstrap_path] %>/modals";
47
+ @import "<%= options[:bootstrap_path] %>/tooltip";
48
+ @import "<%= options[:bootstrap_path] %>/popovers";
49
+ @import "<%= options[:bootstrap_path] %>/carousel";
50
+
51
+ // Utility classes
52
+ @import "<%= options[:bootstrap_path] %>/utilities";
53
+ @import "<%= options[:bootstrap_path] %>/responsive-utilities";
@@ -1,3 +1,3 @@
1
1
  module NetguruBootstrapper
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -1,5 +1,5 @@
1
1
  require 'netguru_bootstrapper/version'
2
+ require 'netguru_bootstrapper/cli'
2
3
 
3
4
  module NetguruBootstrapper
4
- require 'netguru_bootstrapper/engine' if defined?(Rails)
5
5
  end
@@ -19,4 +19,5 @@ Gem::Specification.new do |spec|
19
19
 
20
20
  spec.add_development_dependency "bundler", "~> 1.6"
21
21
  spec.add_development_dependency "rake"
22
+ spec.add_dependency "thor"
22
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: netguru_bootstrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mateusz Czajka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-16 00:00:00.000000000 Z
11
+ date: 2015-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -38,10 +38,25 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: thor
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  description:
42
56
  email:
43
57
  - mat.czajka@gmail.com
44
- executables: []
58
+ executables:
59
+ - netguru_bootstrapper
45
60
  extensions: []
46
61
  extra_rdoc_files: []
47
62
  files:
@@ -50,21 +65,22 @@ files:
50
65
  - LICENSE.txt
51
66
  - README.md
52
67
  - Rakefile
68
+ - bin/netguru_bootstrapper
53
69
  - lib/netguru_bootstrapper.rb
54
- - lib/netguru_bootstrapper/engine.rb
55
- - lib/netguru_bootstrapper/generators/netguru_bootstrapper/bootstrap_generator.rb
56
- - lib/netguru_bootstrapper/generators/templates/application.scss
57
- - lib/netguru_bootstrapper/generators/templates/framework/_components.scss
58
- - lib/netguru_bootstrapper/generators/templates/framework/_overrides.scss
59
- - lib/netguru_bootstrapper/generators/templates/framework/_variables.scss
60
- - lib/netguru_bootstrapper/generators/templates/settings/_breakpoint-variables.scss
61
- - lib/netguru_bootstrapper/generators/templates/settings/_variables.scss
62
- - lib/netguru_bootstrapper/generators/templates/settings/_z-index-variables.scss
63
- - lib/netguru_bootstrapper/generators/templates/utilities/_functions.scss
64
- - lib/netguru_bootstrapper/generators/templates/utilities/_mixins.scss
65
- - lib/netguru_bootstrapper/generators/templates/utilities/_shared.scss
66
- - lib/netguru_bootstrapper/generators/templates/utilities/_typography.scss
70
+ - lib/netguru_bootstrapper/cli.rb
71
+ - lib/netguru_bootstrapper/generator.rb
67
72
  - lib/netguru_bootstrapper/structure_parser.rb
73
+ - lib/netguru_bootstrapper/templates/application.scss
74
+ - lib/netguru_bootstrapper/templates/framework/_components.scss
75
+ - lib/netguru_bootstrapper/templates/framework/_overrides.scss
76
+ - lib/netguru_bootstrapper/templates/framework/_variables.scss
77
+ - lib/netguru_bootstrapper/templates/settings/_breakpoint-variables.scss
78
+ - lib/netguru_bootstrapper/templates/settings/_variables.scss
79
+ - lib/netguru_bootstrapper/templates/settings/_z-index-variables.scss
80
+ - lib/netguru_bootstrapper/templates/utilities/_functions.scss
81
+ - lib/netguru_bootstrapper/templates/utilities/_mixins.scss
82
+ - lib/netguru_bootstrapper/templates/utilities/_shared.scss
83
+ - lib/netguru_bootstrapper/templates/utilities/_typography.scss
68
84
  - lib/netguru_bootstrapper/version.rb
69
85
  - lib/structure.yml
70
86
  - netguru_bootstrapper.gemspec
@@ -88,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
104
  version: '0'
89
105
  requirements: []
90
106
  rubyforge_project:
91
- rubygems_version: 2.4.5
107
+ rubygems_version: 2.4.3
92
108
  signing_key:
93
109
  specification_version: 4
94
110
  summary: Twitter Bootstrap generator for Rails
@@ -1,7 +0,0 @@
1
- require 'rails'
2
- require 'netguru_bootstrapper/generators/netguru_bootstrapper/bootstrap_generator'
3
-
4
- module Gemname
5
- class Engine < Rails::Engine
6
- end
7
- end
@@ -1,41 +0,0 @@
1
- require 'rails/generators'
2
- require 'netguru_bootstrapper/structure_parser'
3
-
4
- module NetguruBootstrapper
5
- module Generators
6
- class BootstrapGenerator < ::Rails::Generators::Base
7
- desc 'Bootstrap CSS generator'
8
- source_root File.expand_path('../../templates', __FILE__)
9
-
10
- def create_root_file
11
- template 'application.scss', "#{base_path}/application.scss"
12
- end
13
-
14
- def create_directories
15
- structure.directories.each do |dir|
16
- empty_directory "#{base_path}/#{dir}"
17
- create_files(dir, structure.files[dir])
18
- end
19
- end
20
-
21
- private
22
-
23
- def structure
24
- StructureParser.new
25
- end
26
-
27
- def create_files(dir, files)
28
- return create_file "#{base_path}/#{dir}/.gitkeep" if files.nil?
29
- files.each { |file| copy_template(dir, file) }
30
- end
31
-
32
- def copy_template(dir, file)
33
- template "#{dir}/#{file}.scss", "#{base_path}/#{dir}/#{file}.scss"
34
- end
35
-
36
- def base_path
37
- 'app/assets/stylesheets'
38
- end
39
- end
40
- end
41
- end
@@ -1,53 +0,0 @@
1
- // Please do not change the order of these files. More more information see:
2
- // https://github.com/twbs/bootstrap-sass/blob/master/assets/stylesheets/_bootstrap.scss
3
-
4
- // Core variables and mixins
5
- @import "bootstrap/variables";
6
- @import "bootstrap/mixins";
7
-
8
- // Reset and dependencies
9
- @import "bootstrap/normalize";
10
- @import "bootstrap/print";
11
- @import "bootstrap/glyphicons";
12
-
13
- // Core CSS
14
- @import "bootstrap/scaffolding";
15
- @import "bootstrap/type";
16
- @import "bootstrap/code";
17
- @import "bootstrap/grid";
18
- @import "bootstrap/tables";
19
- @import "bootstrap/forms";
20
- @import "bootstrap/buttons";
21
-
22
- // Components
23
- @import "bootstrap/component-animations";
24
- @import "bootstrap/dropdowns";
25
- @import "bootstrap/button-groups";
26
- @import "bootstrap/input-groups";
27
- @import "bootstrap/navs";
28
- @import "bootstrap/navbar";
29
- @import "bootstrap/breadcrumbs";
30
- @import "bootstrap/pagination";
31
- @import "bootstrap/pager";
32
- @import "bootstrap/labels";
33
- @import "bootstrap/badges";
34
- @import "bootstrap/jumbotron";
35
- @import "bootstrap/thumbnails";
36
- @import "bootstrap/alerts";
37
- @import "bootstrap/progress-bars";
38
- @import "bootstrap/media";
39
- @import "bootstrap/list-group";
40
- @import "bootstrap/panels";
41
- @import "bootstrap/responsive-embed";
42
- @import "bootstrap/wells";
43
- @import "bootstrap/close";
44
-
45
- // Components w/ JavaScript
46
- @import "bootstrap/modals";
47
- @import "bootstrap/tooltip";
48
- @import "bootstrap/popovers";
49
- @import "bootstrap/carousel";
50
-
51
- // Utility classes
52
- @import "bootstrap/utilities";
53
- @import "bootstrap/responsive-utilities";