staple 0.0.3 → 0.0.4

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: 283a8d9b22610402c81c22bf837c31bf7a93ad19
4
- data.tar.gz: f1f96fa532ef31145f0573fe446bb5a748491836
3
+ metadata.gz: dd448d7a9ef49371ee7f00098e5c1c930cb18fe1
4
+ data.tar.gz: bfc2904665a8a8ffeab40fb38f82e1758d61679c
5
5
  SHA512:
6
- metadata.gz: 92e8e8fd97760d8e5d683461b006ecf0382bff57e25b3af13f9ec12930fe7186941efbd75191984bc3ecedee6aa8f3609754b95cc8dea59375d5145405142d40
7
- data.tar.gz: 8f1fef138794ad6946c2f5fb3ab260de5ece26946973448c474ab9c6daf819f428b641203a154ea07c46444b0f4f7c437e6a676b5cae2500e261acdeaf6d97f3
6
+ metadata.gz: 47c9b59a0b8b7f22c53b0f0459d919d1f159618219770152d4999f01fca0189a50093cac84d55f372033cb880ebd01d5c03f107c10eb486b78b83a618a3da3d9
7
+ data.tar.gz: bb45b43c2981ea06c00f7e28dbb473d1ca2099511d81c8815ef2b453738f432167cf68b281d0417f42edb6166908f37566d9b6a77ffed8c872b6c9eafb3f33d0
data/README.md CHANGED
@@ -5,8 +5,7 @@ CSS platform in the spirit of thoughtbot/refills. Built on top of foundation.
5
5
  ##Install
6
6
  ```ruby
7
7
  #Gemfile
8
- gem 'foundation-rails'
9
- gem 'staple', :git => 'git://github.com/rhelsing/staple.git'
8
+ gem 'staple'
10
9
  ```
11
10
 
12
11
  ```command
@@ -5,7 +5,17 @@ module Staple
5
5
  desc 'Install foundation w/ slim template, simple form and staple base styles'
6
6
  source_root File.join(File.dirname(__FILE__), '..', '..')
7
7
  def foundation_install
8
- generate "foundation:install", "--slim" #rails g foundation:install --slim
8
+ # generate "foundation:install", "--slim" #rails g foundation:install --slim
9
+ insert_into_file "app/assets/javascripts/application#{detect_js_format[0]}", "#{detect_js_format[1]} require foundation\n", :after => "jquery_ujs\n"
10
+ append_to_file "app/assets/javascripts/application#{detect_js_format[0]}", "#{detect_js_format[2]}"
11
+ # NOT NEEDED:
12
+ # settings_file = File.join(File.dirname(__FILE__),"..", "..", "..", "..", "vendor", "assets", "stylesheets", "foundation", "_settings.scss")
13
+ # create_file "app/assets/stylesheets/foundation_and_overrides.scss", File.read(settings_file)
14
+ # append_to_file "app/assets/stylesheets/foundation_and_overrides.scss", "\n@import 'foundation';\n"
15
+ copy_file "source/foundation/foundation_and_overrides.scss", "app/assets/stylesheets/foundation_and_overrides.scss", :force => true
16
+ insert_into_file "app/assets/stylesheets/application#{detect_css_format[0]}", "\n#{detect_css_format[1]} require foundation_and_overrides\n", :after => "require_self"
17
+ template 'source/foundation/application.html.slim', "app/views/layouts/application.html.slim"
18
+ remove_file 'app/views/layouts/application.html.erb'
9
19
  end
10
20
 
11
21
  def simple_form_install
@@ -20,6 +30,10 @@ module Staple
20
30
  insert_into_file "app/assets/stylesheets/application#{detect_css_format[0]}", "\n#{detect_css_format[1]} require font-awesome", :after => "require foundation_and_overrides"
21
31
  end
22
32
 
33
+ def require_simple_form
34
+ prepend_to_file "config/initializers/simple_form.rb", "require 'simple_form'"
35
+ end
36
+
23
37
  def modify_simple_form
24
38
  gsub_file "config/initializers/simple_form_foundation.rb", "b.use :error, wrap_with: { tag: :small }", "b.use :error, :wrap_with => { :tag => :small, :class => :error }"
25
39
  gsub_file "config/initializers/simple_form_foundation.rb", "# b.use :hint, wrap_with: { tag: :span, class: :hint }", "b.use :hint, wrap_with: { tag: :small, class: :error }"
@@ -39,5 +53,11 @@ module Staple
39
53
  return ['.scss', ' //='] if File.exist?('app/assets/stylesheets/application.scss')
40
54
  end
41
55
 
56
+ def detect_js_format
57
+ return ['.coffee', '#=', "\n() ->\n $(document).foundation()\n"] if File.exist?('app/assets/javascripts/application.coffee')
58
+ return ['.js.coffee', '#=', "\n() ->\n $(document).foundation()\n"] if File.exist?('app/assets/javascripts/application.js.coffee')
59
+ return ['.js', '//=', "\n$(function(){ $(document).foundation(); });\n"] if File.exist?('app/assets/javascripts/application.js')
60
+ end
61
+
42
62
  end
43
63
  end
@@ -0,0 +1,17 @@
1
+ doctype html
2
+ html lang="en"
3
+ head
4
+ meta charset="utf-8"
5
+ meta name="viewport" content="width=device-width, initial-scale=1.0"
6
+
7
+ title == content_for?(:title) ? yield(:title) : "Untitled"
8
+
9
+ = stylesheet_link_tag "application"
10
+ = javascript_include_tag "vendor/modernizr"
11
+ = csrf_meta_tag
12
+
13
+ body
14
+
15
+ == yield
16
+
17
+ = javascript_include_tag "application"
data/staple.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "staple"
7
- spec.version = "0.0.3"
7
+ spec.version = "0.0.4"
8
8
  spec.summary = "a high level ui generator (COMING SOON)"
9
9
  spec.description = "Does not work yet. Coming Soon. Built on top of foundation. In the spirit of thoughtbot/refills"
10
10
  spec.authors = ["Ryan Helsing"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: staple
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Helsing
@@ -160,7 +160,8 @@ files:
160
160
  - source/_vertical_tabs.html.erb
161
161
  - source/_video.html.erb
162
162
  - source/components.html.erb
163
- - source/foundation_and_overrides.scss
163
+ - source/foundation/application.html.slim
164
+ - source/foundation/foundation_and_overrides.scss
164
165
  - source/index.html.erb
165
166
  - source/javascripts/all.js
166
167
  - source/javascripts/jquery.erToc.js