designmodo-flatuipro-rails 1.1.3.0 → 1.1.3.1
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 +4 -4
- data/README.md +6 -0
- data/lib/designmodo/flatuipro/rails.rb +1 -1
- data/lib/designmodo/flatuipro/rails/version.rb +1 -1
- data/lib/generators/flatuipro/app_install/app_install_generator.rb +27 -0
- data/lib/generators/flatuipro/demo/demo_generator.rb +2 -2
- data/lib/generators/flatuipro/install/install_generator.rb +27 -20
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1eec85a2a52dcaf1983941346355389f4b88815e
|
4
|
+
data.tar.gz: 55ecf9d398ee210501d766d0e3e59b7fc92c1b5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f64da2a25b0582599fffbf418e0cf44d8d6b1a2d201f5105cb6e1218b6f1eb5b9571f1cdfc0fed65033f6d524118146be600bb7b9097d1874830de21c64f17a9
|
7
|
+
data.tar.gz: 8bb7018a16cc867fe33a2ec50161fcfd793cdf37b3d87b300c1e6b15bd8e8cbbbc3c5730685f206fb416a3fd1902b44cf5cf74edb1487ef57baf7d7200818f65
|
data/README.md
CHANGED
@@ -43,7 +43,13 @@ This gem will detect whether you chose less/static for the twitter-bootstrap-rai
|
|
43
43
|
## Thanks
|
44
44
|
If you haven't bought it already, please use my Designmodo Affiliate Link (image above)
|
45
45
|
|
46
|
+
Thanks [@jehughes](https://github.com/jehughes) for the blog post that inspired me to stop being lazy and write the demo page generator =)
|
47
|
+
|
46
48
|
## Changes
|
49
|
+
#### 1.1.3.1
|
50
|
+
* Move directory from vendor -> app because of rails 4 (https://github.com/rails/rails/pull/7968)
|
51
|
+
* Ensure all assets are precompiled correctly if so desired
|
52
|
+
|
47
53
|
#### 1.1.3.0
|
48
54
|
* Support Flat UI Pro 1.1.3
|
49
55
|
* Add new 'flatuipro:demo' generator to integrate demo page
|
@@ -8,7 +8,7 @@ module Designmodo
|
|
8
8
|
:after => 'less-rails.after.load_config_initializers',
|
9
9
|
:group => :all do |app|
|
10
10
|
if defined?(Less)
|
11
|
-
app.config.less.paths << File.join(config.root, '
|
11
|
+
app.config.less.paths << File.join(config.root, 'app', 'less')
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
require 'pathname'
|
3
|
+
|
4
|
+
module Flatuipro
|
5
|
+
module Generators
|
6
|
+
class AppInstallGenerator < Rails::Generators::Base
|
7
|
+
desc "Install to rails app 'vendor' directory"
|
8
|
+
source_root File.expand_path("../../../../../vendor/assets", __FILE__)
|
9
|
+
|
10
|
+
# Detect if Flat UI Pro assets copied over to gem
|
11
|
+
def check_flatuipro_install
|
12
|
+
unless File.exist?(File.expand_path("../../../../../vendor/assets", __FILE__))
|
13
|
+
raise "Please run install generator first"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def copy_to_vendor
|
18
|
+
directory "fonts", "vendor/assets/fonts"
|
19
|
+
directory "images", "vendor/assets/images"
|
20
|
+
directory "javascripts", "vendor/assets/javascripts"
|
21
|
+
if File.exist?("less")
|
22
|
+
directory "less", "vendor/assets/less"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -5,11 +5,11 @@ module Flatuipro
|
|
5
5
|
module Generators
|
6
6
|
class DemoGenerator < Rails::Generators::Base
|
7
7
|
desc "Setup Flat UI Pro Demo page."
|
8
|
-
source_root File.expand_path("../../../../../
|
8
|
+
source_root File.expand_path("../../../../../app/assets/demo", __FILE__)
|
9
9
|
|
10
10
|
# Detect if Flat UI Pro assets copied over to gem
|
11
11
|
def check_flatuipro_install
|
12
|
-
unless File.exist?(File.expand_path("../../../../../
|
12
|
+
unless File.exist?(File.expand_path("../../../../../app/assets", __FILE__))
|
13
13
|
raise "Please run install generator first"
|
14
14
|
end
|
15
15
|
end
|
@@ -9,30 +9,30 @@ module Flatuipro
|
|
9
9
|
source_root File.expand_path("../templates", __FILE__)
|
10
10
|
|
11
11
|
def copy_assets
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
12
|
+
gem_assets_dir = File.expand_path("../../../../../app/assets", __FILE__)
|
13
|
+
pro_dir = flatuipro_dir
|
14
|
+
|
15
|
+
unless File.exist?(File.join(pro_dir, "index.html"))
|
16
|
+
pro_dir = File.join(pro_dir, "HTML/UI")
|
17
|
+
end
|
18
|
+
unless File.directory?(pro_dir) && File.exist?(File.join(pro_dir, "index.html"))
|
19
|
+
raise "Invalid Flat UI Pro directory"
|
19
20
|
end
|
20
|
-
gem_assets_dir = File.expand_path("../../../../../vendor/assets", __FILE__)
|
21
21
|
|
22
22
|
if use_less?
|
23
|
-
directory File.join(
|
23
|
+
directory File.join(pro_dir, "less"), File.join(gem_assets_dir, "less")
|
24
24
|
else
|
25
|
-
copy_file File.join(
|
25
|
+
copy_file File.join(pro_dir, "css", "flat-ui.css"), "app/assets/stylesheets/flat-ui.css"
|
26
26
|
end
|
27
|
-
directory File.join(
|
28
|
-
directory File.join(
|
29
|
-
directory File.join(
|
27
|
+
directory File.join(pro_dir, "js"), File.join(gem_assets_dir, "javascripts")
|
28
|
+
directory File.join(pro_dir, "images"), File.join(gem_assets_dir, "images")
|
29
|
+
directory File.join(pro_dir, "fonts"), File.join(gem_assets_dir, "fonts")
|
30
30
|
|
31
31
|
# Demo page assets
|
32
|
-
copy_file File.join(
|
33
|
-
copy_file File.join(
|
34
|
-
copy_file File.join(
|
35
|
-
copy_file File.join(
|
32
|
+
copy_file File.join(pro_dir, "index.html"), File.join(gem_assets_dir, "demo", "index.html")
|
33
|
+
copy_file File.join(pro_dir, "js", "application.js"), File.join(gem_assets_dir, "demo", "flatuipro-demo.js")
|
34
|
+
copy_file File.join(pro_dir, "css", "demo.css"), File.join(gem_assets_dir, "demo", "flatuipro-demo.css")
|
35
|
+
copy_file File.join(pro_dir, "less", "demo.less"), File.join(gem_assets_dir, "demo", "flatuipro-demo.less")
|
36
36
|
end
|
37
37
|
|
38
38
|
def add_assets
|
@@ -83,15 +83,22 @@ module Flatuipro
|
|
83
83
|
end
|
84
84
|
|
85
85
|
def patch_assets
|
86
|
-
gem_assets_dir = File.expand_path("../../../../../
|
86
|
+
gem_assets_dir = File.expand_path("../../../../../app/assets", __FILE__)
|
87
87
|
|
88
88
|
# Stylesheets patches
|
89
89
|
# image url() -> image-url()
|
90
90
|
# font url() -> font-url()
|
91
91
|
# LESS
|
92
92
|
if use_less?
|
93
|
-
#
|
94
|
-
|
93
|
+
# switch.less
|
94
|
+
# More involved patch because less-rails won't translate when inside ~""
|
95
|
+
# Create LESS variable and interpolate into .mask(~"")
|
96
|
+
switch_file = File.join(gem_assets_dir, "less/modules", "switch.less")
|
97
|
+
mask_image_url = "@mask-image-url: image-url('switch/mask.png');\n"
|
98
|
+
insert_into_file switch_file, mask_image_url, :before => ".has-switch {\n"
|
99
|
+
gsub_file switch_file, /url\('\.\.\/images\/.+?\)/, "@{mask-image-url}"
|
100
|
+
|
101
|
+
# icon-font.less
|
95
102
|
gsub_file File.join(gem_assets_dir, "less", "icon-font.less"), /url\("\.\.\/fonts\//, 'font-url("'
|
96
103
|
# CSS
|
97
104
|
else
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: designmodo-flatuipro-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.3.
|
4
|
+
version: 1.1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Chou
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07
|
11
|
+
date: 2013-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: twitter-bootstrap-rails
|
@@ -62,6 +62,7 @@ extra_rdoc_files: []
|
|
62
62
|
files:
|
63
63
|
- lib/designmodo/flatuipro/rails/version.rb
|
64
64
|
- lib/designmodo/flatuipro/rails.rb
|
65
|
+
- lib/generators/flatuipro/app_install/app_install_generator.rb
|
65
66
|
- lib/generators/flatuipro/demo/demo_generator.rb
|
66
67
|
- lib/generators/flatuipro/install/install_generator.rb
|
67
68
|
- lib/generators/flatuipro/install/templates/application.css
|
@@ -78,8 +79,8 @@ metadata: {}
|
|
78
79
|
post_install_message: |-
|
79
80
|
**********************************************
|
80
81
|
|
81
|
-
One *must* run
|
82
|
-
|
82
|
+
One *must* run `rails generate flatuipro:install <Flat UI Pro Directory>`
|
83
|
+
when gem updated
|
83
84
|
|
84
85
|
**********************************************
|
85
86
|
rdoc_options: []
|