metro-ui-rails 0.15.8.11 → 0.15.8.12
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.
- data/.gitignore +1 -0
- data/README.md +11 -4
- data/lib/generators/metro/install/install_generator.rb +39 -0
- data/lib/generators/metro/install/templates/application.css +7 -0
- data/lib/generators/metro/install/templates/application.js +10 -0
- data/lib/generators/metro/install/templates/metro_ui_and_overrides.less +2 -0
- data/lib/metro/ui/rails/version.rb +1 -1
- data/metro-ui-rails.gemspec +0 -6
- metadata +6 -18
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -6,16 +6,23 @@ This gem integrates [Metro-UI-CSS](https://github.com/olton/Metro-UI-CSS) toolki
|
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
9
|
-
Add
|
10
|
-
|
9
|
+
Add these lines to your application's Gemfile:
|
10
|
+
|
11
|
+
gem 'therubyracer'
|
11
12
|
gem 'metro-ui-rails'
|
12
13
|
|
13
|
-
And then execute:
|
14
|
+
And then execute in command line:
|
14
15
|
|
15
16
|
$ bundle
|
16
17
|
|
17
18
|
## Installing to Rails project:
|
18
19
|
|
20
|
+
Run rails generator:
|
21
|
+
|
22
|
+
rails generate metro:install
|
23
|
+
|
24
|
+
### Or install it manually
|
25
|
+
|
19
26
|
Require metro-ui/metro.less in your application.less:
|
20
27
|
|
21
28
|
@import 'metro-ui/modern.less';
|
@@ -41,4 +48,4 @@ Example:
|
|
41
48
|
## License
|
42
49
|
|
43
50
|
This project only integrates [Metro-UI-CSS](https://github.com/olton/Metro-UI-CSS),
|
44
|
-
thus all credits go to Sergey Pimenov, see his [license](https://github.com/olton/Metro-UI-CSS).
|
51
|
+
thus all credits go to Sergey Pimenov, see his [license](https://github.com/olton/Metro-UI-CSS).
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
|
3
|
+
module Metro
|
4
|
+
module Generators
|
5
|
+
class InstallGenerator < ::Rails::Generators::Base
|
6
|
+
|
7
|
+
source_root File.expand_path("../templates", __FILE__)
|
8
|
+
desc "This generator installs Metro-UI-CSS to Asset Pipeline"
|
9
|
+
|
10
|
+
def add_assets
|
11
|
+
if File.exist?('app/assets/javascripts/application.js')
|
12
|
+
insert_into_file "app/assets/javascripts/application.js", "//= require metro-ui\n", :after => "jquery_ujs\n"
|
13
|
+
else
|
14
|
+
copy_file "application.js", "app/assets/javascripts/application.js"
|
15
|
+
end
|
16
|
+
|
17
|
+
if File.exist?('app/assets/stylesheets/application.css')
|
18
|
+
content = File.read("app/assets/stylesheets/application.css")
|
19
|
+
unless content.match(/require_tree\s+\.\s*$/)
|
20
|
+
style_require_block = " *= require metro_ui_and_overrides\n"
|
21
|
+
insert_into_file "app/assets/stylesheets/application.css", style_require_block, :after => "require_self\n"
|
22
|
+
end
|
23
|
+
else
|
24
|
+
copy_file "application.css", "app/assets/stylesheets/application.css"
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
def add_metro_ui
|
30
|
+
copy_file "metro_ui_and_overrides.less", "app/assets/stylesheets/metro_ui_and_overrides.css.less"
|
31
|
+
end
|
32
|
+
|
33
|
+
def cleanup_legacy
|
34
|
+
gsub_file("app/assets/stylesheets/application.css", %r|\s*\*=\s*metro-ui/modern\s*\n|, "")
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll automatically include all the stylesheets available in this directory
|
3
|
+
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
|
4
|
+
* the top of the compiled file, but it's generally better to create a new file per style scope.
|
5
|
+
*= require_self
|
6
|
+
*= require_tree .
|
7
|
+
*/
|
@@ -0,0 +1,10 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into including all the files listed below.
|
2
|
+
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
|
3
|
+
// be included in the compiled file accessible from http://example.com/assets/application.js
|
4
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
5
|
+
// the compiled file.
|
6
|
+
//
|
7
|
+
//= require jquery
|
8
|
+
//= require jquery_ujs
|
9
|
+
//= require metro-ui
|
10
|
+
//= require_tree .
|
data/metro-ui-rails.gemspec
CHANGED
@@ -15,12 +15,6 @@ Gem::Specification.new do |gem|
|
|
15
15
|
gem.files = `git ls-files`.split($/)
|
16
16
|
gem.require_paths = ["lib"]
|
17
17
|
|
18
|
-
if RUBY_PLATFORM == 'java'
|
19
|
-
gem.add_dependency 'therubyrhino', '~> 1.73.4'
|
20
|
-
else
|
21
|
-
gem.add_dependency 'therubyracer', '>= 0.10.2'
|
22
|
-
end
|
23
|
-
|
24
18
|
gem.add_runtime_dependency 'less-rails', '~> 2.2.3'
|
25
19
|
gem.add_development_dependency 'rails', '>= 3.1'
|
26
20
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metro-ui-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.15.8.
|
4
|
+
version: 0.15.8.12
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,24 +9,8 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: therubyracer
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ! '>='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: 0.10.2
|
22
|
-
type: :runtime
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ! '>='
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: 0.10.2
|
30
14
|
- !ruby/object:Gem::Dependency
|
31
15
|
name: less-rails
|
32
16
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,6 +56,10 @@ files:
|
|
72
56
|
- Gemfile
|
73
57
|
- README.md
|
74
58
|
- Rakefile
|
59
|
+
- lib/generators/metro/install/install_generator.rb
|
60
|
+
- lib/generators/metro/install/templates/application.css
|
61
|
+
- lib/generators/metro/install/templates/application.js
|
62
|
+
- lib/generators/metro/install/templates/metro_ui_and_overrides.less
|
75
63
|
- lib/generators/metro/layout/layout_generator.rb
|
76
64
|
- lib/generators/metro/layout/templates/layout.html.erb
|
77
65
|
- lib/metro-ui-rails.rb
|