modular-grid 0.0.12 → 0.0.13

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
2
  SHA1:
3
- metadata.gz: c3edf87ad594f8d23073dad2852335782df49218
4
- data.tar.gz: 283d728fc30a467def50af5c4697565b0e343c18
3
+ metadata.gz: 5c9c05276ebd8041eea14dbbaaad6a9dc789ecdc
4
+ data.tar.gz: 80536753f23fa66dbe80981e85a8251b134dedcf
5
5
  SHA512:
6
- metadata.gz: bdcb295883f486cd512dee86745629c08d108dcbf06a41e2c49f00392021018fd7269bb056f132e4a4bf901d8bf1dd510b4019ed66c72134200af944ad726296
7
- data.tar.gz: d3a93be6a7648e5c51be3330b9b1c097ed1e1a4c2d03438819f4a8d57205b1667f3fbb840ada59a159799df6b9643b97ff2880e3c52ba55672c5be2f66527d9d
6
+ metadata.gz: 3b384562069ff54c4f10d8000d9dbcdafc8c49e22fa25d3366506515194b35cf64e2680208a26ddca54e27db99626bbb1e18edf802b51e678ea495517bad53ee
7
+ data.tar.gz: 6da4d1723966ac61c73a617062c2eb1662a16d73ab615448a4ef8010edeb6cfd747f37d8caa336b15266097824529f4cae72408f93aeceb3bebedac923752b14
@@ -1,2 +1,5 @@
1
+ $modular-render: true;
2
+ $modular-debug: true;
3
+
1
4
  @import 'grid/render',
2
5
  'grid/utils/reset';
data/bin/modular ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # CodeKit needs relative paths
4
+ require File.dirname(__FILE__) + '/../lib/modular.rb'
5
+
6
+ Modular::Generator.start
data/lib/modular.rb CHANGED
@@ -1,4 +1,8 @@
1
- require "modular/version"
1
+ # CodeKit needs relative paths
2
+ dir = File.dirname(__FILE__)
3
+ $LOAD_PATH.unshift dir unless $LOAD_PATH.include?(dir)
4
+
5
+ require "modular/generator"
2
6
 
3
7
  unless defined?(Sass)
4
8
  require 'sass'
@@ -17,6 +21,7 @@ module Modular
17
21
  end
18
22
  end
19
23
  else
20
- Sass.load_paths << File.expand_path("../../app/assets/stylesheets", __FILE__)
24
+ modular_path = File.expand_path("../../app/assets/stylesheets", __FILE__)
25
+ ENV["SASS_PATH"] = [ENV["SASS_PATH"], modular_path].compact.join(File::PATH_SEPARATOR)
21
26
  end
22
27
  end
@@ -0,0 +1,80 @@
1
+ require 'modular/version'
2
+ require "fileutils"
3
+ require 'thor'
4
+
5
+ module Modular
6
+ class Generator < Thor
7
+ map ['-v', '--version'] => :version
8
+
9
+ desc 'install', 'Install Modular into your project'
10
+ method_options :path => :string, :force => :boolean
11
+ def install
12
+ if modular_files_already_exist? && !options[:force]
13
+ puts "Modular files already installed, doing nothing."
14
+ else
15
+ install_files
16
+ puts "Modular files installed to #{install_path}/"
17
+ end
18
+ end
19
+
20
+ desc 'update', 'Update Modular'
21
+ method_options :path => :string
22
+ def update
23
+ if modular_files_already_exist?
24
+ remove_modular_directory
25
+ install_files
26
+ puts "Modular files updated."
27
+ else
28
+ puts "No existing modular installation. Doing nothing."
29
+ end
30
+ end
31
+
32
+ desc 'version', 'Show Modular version'
33
+ def version
34
+ say "Modular #{Modular::VERSION}"
35
+ end
36
+
37
+ private
38
+
39
+ def modular_files_already_exist?
40
+ install_path.exist?
41
+ end
42
+
43
+ def install_path
44
+ @install_path ||= if options[:path]
45
+ Pathname.new(File.join(options[:path], 'modular'))
46
+ else
47
+ Pathname.new('modular')
48
+ end
49
+ end
50
+
51
+ def install_files
52
+ make_install_directory
53
+ copy_in_scss_files
54
+ end
55
+
56
+ def remove_modular_directory
57
+ FileUtils.rm_rf("modular")
58
+ end
59
+
60
+ def make_install_directory
61
+ FileUtils.mkdir_p(install_path)
62
+ end
63
+
64
+ def copy_in_scss_files
65
+ FileUtils.cp_r(all_stylesheets, install_path)
66
+ end
67
+
68
+ def all_stylesheets
69
+ Dir["#{stylesheets_directory}/*"]
70
+ end
71
+
72
+ def stylesheets_directory
73
+ File.join(top_level_directory, "app", "assets", "stylesheets")
74
+ end
75
+
76
+ def top_level_directory
77
+ File.dirname(File.dirname(File.dirname(__FILE__)))
78
+ end
79
+ end
80
+ end
@@ -1,3 +1,3 @@
1
1
  module Modular
2
- VERSION = "0.0.12"
2
+ VERSION = "0.0.13"
3
3
  end
data/modular.gemspec CHANGED
@@ -21,4 +21,5 @@ Gem::Specification.new do |spec|
21
21
  spec.add_development_dependency "bundler", "~> 1.7"
22
22
  spec.add_development_dependency "rake", "~> 10.0"
23
23
  spec.add_dependency 'sass','~> 3.2.0'
24
+ spec.add_dependency 'thor'
24
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: modular-grid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dylan Wreggelsworth
@@ -52,10 +52,25 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 3.2.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: thor
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  description: An SCSS grid library.
56
70
  email:
57
71
  - dylan@bvrgroup.us
58
- executables: []
72
+ executables:
73
+ - modular
59
74
  extensions: []
60
75
  extra_rdoc_files: []
61
76
  files:
@@ -75,6 +90,7 @@ files:
75
90
  - app/assets/stylesheets/grid/_render.scss
76
91
  - app/assets/stylesheets/grid/utils/_media.scss
77
92
  - app/assets/stylesheets/grid/utils/_reset.scss
93
+ - bin/modular
78
94
  - css/modular.css
79
95
  - css/modular.css.map
80
96
  - css/modular.min.css
@@ -85,6 +101,7 @@ files:
85
101
  - example/index.html
86
102
  - lib/modular.rb
87
103
  - lib/modular/engine.rb
104
+ - lib/modular/generator.rb
88
105
  - lib/modular/version.rb
89
106
  - lib/tasks/install.rake
90
107
  - modular.gemspec