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 +4 -4
- data/app/assets/stylesheets/_modular.scss +3 -0
- data/bin/modular +6 -0
- data/lib/modular.rb +7 -2
- data/lib/modular/generator.rb +80 -0
- data/lib/modular/version.rb +1 -1
- data/modular.gemspec +1 -0
- metadata +19 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c9c05276ebd8041eea14dbbaaad6a9dc789ecdc
|
4
|
+
data.tar.gz: 80536753f23fa66dbe80981e85a8251b134dedcf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b384562069ff54c4f10d8000d9dbcdafc8c49e22fa25d3366506515194b35cf64e2680208a26ddca54e27db99626bbb1e18edf802b51e678ea495517bad53ee
|
7
|
+
data.tar.gz: 6da4d1723966ac61c73a617062c2eb1662a16d73ab615448a4ef8010edeb6cfd747f37d8caa336b15266097824529f4cae72408f93aeceb3bebedac923752b14
|
data/bin/modular
ADDED
data/lib/modular.rb
CHANGED
@@ -1,4 +1,8 @@
|
|
1
|
-
|
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
|
-
|
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
|
data/lib/modular/version.rb
CHANGED
data/modular.gemspec
CHANGED
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.
|
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
|