designmodo-flatuipro-rails 1.1.1 → 1.1.3.0
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69cb141c5fc86d8e7ee2e299c86d9a244bc5cf0b
|
4
|
+
data.tar.gz: 5bb564a251c70edfe4527d0b4e5bed64af85719e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7ff16efcb318a0c3dfdd0a5174c1e916764a90be7416875847325fe14fd0227e72917988ccb906f5497e1b9af39bb6d246517787caf0e1327b6f65bf81ee00a
|
7
|
+
data.tar.gz: a835a30df52a48eb2f6472eebbef97e636efd032123721296994fe1bdd5e6fb66bbc70c7ac4dabcd405655ca8fdcbdfa2be8843493e5b39b8c7c7dfc5f276d03
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@ This gem integrates Designmodo's Flat UI Pro Design for Twitter Bootstrap into t
|
|
4
4
|
|
5
5
|
You **must** purchase and download a licensed copy to use this gem (none of the assets are packaged per Flat UI Pro license). You may do so by clicking the above image (full disclosure: affiliate link).
|
6
6
|
|
7
|
-
The version major and
|
7
|
+
The version major and minors should match the Flat UI Pro version. Anything after these are gem versions.
|
8
8
|
|
9
9
|
## Installation
|
10
10
|
First install and configure dependencies: [twitter-bootstrap-rails](https://github.com/seyhunak/twitter-bootstrap-rails) and [jquery-ui-rails](https://github.com/joliss/jquery-ui-rails) .
|
@@ -21,21 +21,38 @@ Or install it yourself as:
|
|
21
21
|
|
22
22
|
$ gem install designmodo-flatuipro-rails
|
23
23
|
|
24
|
-
|
24
|
+
### Install Generator
|
25
|
+
One **must** run this after install *and* after update of designmodo-flatuipro-rails gem:
|
25
26
|
|
26
27
|
$ rails generate flatuipro:install <Flat UI Pro Directory>
|
27
28
|
|
29
|
+
### Demo Page Generator
|
30
|
+
If you want to integrate the demo page:
|
31
|
+
|
32
|
+
$ rails generate flatuipro:demo
|
33
|
+
|
34
|
+
The demo generator creates a 'flatuipro\_demo' controller with a default 'flatuipro\_demo/index' route.
|
35
|
+
|
36
|
+
IMPORTANT: After deciding which components to use from the demo page, make sure to only include the corresponding less/css and js that you need from the flatuipro-demo.* files
|
37
|
+
|
28
38
|
## Usage
|
29
39
|
After running the install generator, all assets should be setup.
|
30
40
|
|
31
41
|
This gem will detect whether you chose less/static for the twitter-bootstrap-rails install and generate either less/css flatuipro files accordingly.
|
32
42
|
|
33
43
|
## Thanks
|
34
|
-
|
44
|
+
If you haven't bought it already, please use my Designmodo Affiliate Link (image above)
|
45
|
+
|
46
|
+
## Changes
|
47
|
+
#### 1.1.3.0
|
48
|
+
* Support Flat UI Pro 1.1.3
|
49
|
+
* Add new 'flatuipro:demo' generator to integrate demo page
|
35
50
|
|
36
|
-
|
51
|
+
#### 1.1.1
|
52
|
+
* Minor documentation changes to include Rails 4 compatibility
|
37
53
|
|
38
|
-
|
54
|
+
#### 1.1.0
|
55
|
+
* Initial commit
|
39
56
|
|
40
57
|
## Contributing
|
41
58
|
|
@@ -0,0 +1,68 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
require 'pathname'
|
3
|
+
|
4
|
+
module Flatuipro
|
5
|
+
module Generators
|
6
|
+
class DemoGenerator < Rails::Generators::Base
|
7
|
+
desc "Setup Flat UI Pro Demo page."
|
8
|
+
source_root File.expand_path("../../../../../vendor/assets/demo", __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 generate_demo_controller
|
18
|
+
generate "controller flatuipro_demo index --no-helper --no-test-framework --no-assets"
|
19
|
+
end
|
20
|
+
|
21
|
+
def add_demo_assets
|
22
|
+
# Overwrite generated index.html.erb with demo html
|
23
|
+
copy_file "index.html.erb", "app/views/flatuipro_demo/index.html.erb"
|
24
|
+
|
25
|
+
# Add demo less/css
|
26
|
+
if use_less?
|
27
|
+
copy_file "flatuipro-demo.less", "app/assets/stylesheets/flatuipro-demo.less"
|
28
|
+
else
|
29
|
+
copy_file "flatuipro-demo.css", "app/assets/stylesheets/flatuipro-demo.css"
|
30
|
+
end
|
31
|
+
|
32
|
+
# Handle CSS Manifest
|
33
|
+
css_manifest = "app/assets/stylesheets/application.css"
|
34
|
+
if File.exist?(css_manifest)
|
35
|
+
content = File.read(css_manifest)
|
36
|
+
unless content.match(/require_tree\s+\./)
|
37
|
+
style_require_block = " *= require flatuipro-demo\n"
|
38
|
+
insert_into_file css_manifest, style_require_block, :after => "require_self\n"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
# Add demo javascript
|
43
|
+
copy_file "flatuipro-demo.js", "app/assets/javascripts/flatuipro-demo.js"
|
44
|
+
|
45
|
+
# Handle JS Manifest
|
46
|
+
js_manifest = "app/assets/javascripts/application.js"
|
47
|
+
if File.exist?(js_manifest)
|
48
|
+
content = File.read(js_manifest)
|
49
|
+
unless content.match(/require_tree\s+\./)
|
50
|
+
insert_into_file js_manifest, "//= require flatuipro-demo\n", :after => "flatuipro\n"
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
private
|
56
|
+
# Detect if twitter-bootstrap-rails installed with LESS or static stylesheets
|
57
|
+
def use_less?
|
58
|
+
if File.exist?("app/assets/stylesheets/bootstrap_and_overrides.css.less")
|
59
|
+
return true
|
60
|
+
elsif File.exist?("app/assets/stylesheets/bootstrap_and_overrides.css")
|
61
|
+
return false
|
62
|
+
else
|
63
|
+
raise "Cannot detect twitter-bootstrap-rails install"
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -24,10 +24,15 @@ module Flatuipro
|
|
24
24
|
else
|
25
25
|
copy_file File.join(flatuipro_dir, "css", "flat-ui.css"), "app/assets/stylesheets/flat-ui.css"
|
26
26
|
end
|
27
|
-
directory File.join(flatuipro_dir, "js"),
|
28
|
-
directory File.join(flatuipro_dir, "images"),
|
29
|
-
|
30
|
-
|
27
|
+
directory File.join(flatuipro_dir, "js"), File.join(gem_assets_dir, "javascripts")
|
28
|
+
directory File.join(flatuipro_dir, "images"), File.join(gem_assets_dir, "images")
|
29
|
+
directory File.join(flatuipro_dir, "fonts"), File.join(gem_assets_dir, "fonts")
|
30
|
+
|
31
|
+
# Demo page assets
|
32
|
+
copy_file File.join(flatuipro_dir, "index.html"), File.join(gem_assets_dir, "demo", "index.html")
|
33
|
+
copy_file File.join(flatuipro_dir, "js", "application.js"), File.join(gem_assets_dir, "demo", "flatuipro-demo.js")
|
34
|
+
copy_file File.join(flatuipro_dir, "css", "demo.css"), File.join(gem_assets_dir, "demo", "flatuipro-demo.css")
|
35
|
+
copy_file File.join(flatuipro_dir, "less", "demo.less"), File.join(gem_assets_dir, "demo", "flatuipro-demo.less")
|
31
36
|
end
|
32
37
|
|
33
38
|
def add_assets
|
@@ -94,6 +99,25 @@ module Flatuipro
|
|
94
99
|
gsub_file "app/assets/stylesheets/flat-ui.css", /url\("\.\.\/fonts\//, 'url("/assets/'
|
95
100
|
end
|
96
101
|
|
102
|
+
# Demo page patches
|
103
|
+
file = File.join(gem_assets_dir, "demo", "index.html")
|
104
|
+
# Fix image links
|
105
|
+
gsub_file file, /<img src="images\/.+?>/ do |s|
|
106
|
+
match = /images\/(.+?)"/.match(s)
|
107
|
+
'<%= image_tag "' + match[1] + '" %>'
|
108
|
+
end
|
109
|
+
|
110
|
+
# Remove everything before <body> tag and after 'Load JS', inclusive
|
111
|
+
new_file = File.open("#{file}.erb", "w")
|
112
|
+
include_line = false
|
113
|
+
IO.foreach(file) do |line|
|
114
|
+
include_line = false if line =~ /Load JS/
|
115
|
+
|
116
|
+
new_file.write line if include_line
|
117
|
+
|
118
|
+
include_line = true if line =~ /<body>/
|
119
|
+
end
|
120
|
+
new_file.close
|
97
121
|
end
|
98
122
|
|
99
123
|
private
|
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.
|
4
|
+
version: 1.1.3.0
|
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-
|
11
|
+
date: 2013-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: twitter-bootstrap-rails
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 4.0.3
|
55
55
|
description: designmodo-flatuipro-rails integrates Flat UI Pro for Rails 3 and 4 Asset
|
56
|
-
|
56
|
+
Pipelines
|
57
57
|
email:
|
58
58
|
- sam.chou@windystudios.com
|
59
59
|
executables: []
|
@@ -62,11 +62,12 @@ 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/
|
66
|
-
- lib/generators/flatuipro/install/
|
65
|
+
- lib/generators/flatuipro/demo/demo_generator.rb
|
66
|
+
- lib/generators/flatuipro/install/install_generator.rb
|
67
67
|
- lib/generators/flatuipro/install/templates/application.css
|
68
|
+
- lib/generators/flatuipro/install/templates/application.js
|
69
|
+
- lib/generators/flatuipro/install/templates/flatuipro.js
|
68
70
|
- lib/generators/flatuipro/install/templates/flatuipro.less
|
69
|
-
- lib/generators/flatuipro/install/install_generator.rb
|
70
71
|
- LICENSE.txt
|
71
72
|
- Rakefile
|
72
73
|
- README.md
|
@@ -96,8 +97,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
97
|
version: '0'
|
97
98
|
requirements: []
|
98
99
|
rubyforge_project:
|
99
|
-
rubygems_version: 2.0.
|
100
|
+
rubygems_version: 2.0.3
|
100
101
|
signing_key:
|
101
102
|
specification_version: 4
|
102
|
-
summary: Flat UI Pro for Rails 3
|
103
|
+
summary: Flat UI Pro for Rails 3 and 4 Asset Pipelines
|
103
104
|
test_files: []
|