foundation-rails-helpers 0.0.2 → 0.0.3

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: 9d66f248aef42db7afb8ecbe65f10dd2398b7ac7
4
- data.tar.gz: d75db02c8b0385c26017a20adfba57f2ea5a16f5
3
+ metadata.gz: 15c2ad1b6b1e74684830243fc6ad18d47c8df760
4
+ data.tar.gz: 8870358865fb336eaa7c1f9c41e1d98a89184b7d
5
5
  SHA512:
6
- metadata.gz: 7c99390a72d92d30187f3ad03fe3e136ff6b133ada9e7eec21b0cc8c5c0f00d2a838025c49fa9a4501e67d50681f81e28bbef99bb69eb4c6252c7b8e04625552
7
- data.tar.gz: 96afb48787d860b50c811d6445083e00ac85aa22f4338cd6d8b8479afbecf7d14da1853b82ad465a00fd128df86637ee14752bbf078baea002f919d0d87849a3
6
+ metadata.gz: 1122631d3dcdca0f270cd091f21cc14dc4bb5c3bf8627195db262300972531f5cbfa27e7feabf2e71d4c02b89522868c71a9efa225c4b93e24907d5dd5291bf0
7
+ data.tar.gz: cb9065b3eecd61bc0f36049a59cfda0e3ef8ff3f343cffb17376c7ad4c956ebe922818886d1ca97f8750693c10ee7e9d0d4d4d7a0d03b33c9218ce98466199ff
@@ -0,0 +1,3 @@
1
+ .bundle/
2
+ log/*.log
3
+ pkg/
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --color
2
+ --warnings
3
+ --require spec_helper
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
@@ -0,0 +1,104 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ foundation-rails-helpers (0.0.1)
5
+ rails (> 4.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actionmailer (4.1.1)
11
+ actionpack (= 4.1.1)
12
+ actionview (= 4.1.1)
13
+ mail (~> 2.5.4)
14
+ actionpack (4.1.1)
15
+ actionview (= 4.1.1)
16
+ activesupport (= 4.1.1)
17
+ rack (~> 1.5.2)
18
+ rack-test (~> 0.6.2)
19
+ actionview (4.1.1)
20
+ activesupport (= 4.1.1)
21
+ builder (~> 3.1)
22
+ erubis (~> 2.7.0)
23
+ activemodel (4.1.1)
24
+ activesupport (= 4.1.1)
25
+ builder (~> 3.1)
26
+ activerecord (4.1.1)
27
+ activemodel (= 4.1.1)
28
+ activesupport (= 4.1.1)
29
+ arel (~> 5.0.0)
30
+ activesupport (4.1.1)
31
+ i18n (~> 0.6, >= 0.6.9)
32
+ json (~> 1.7, >= 1.7.7)
33
+ minitest (~> 5.1)
34
+ thread_safe (~> 0.1)
35
+ tzinfo (~> 1.1)
36
+ arel (5.0.1.20140414130214)
37
+ builder (3.2.2)
38
+ diff-lcs (1.2.5)
39
+ erubis (2.7.0)
40
+ hike (1.2.3)
41
+ i18n (0.6.9)
42
+ json (1.8.1)
43
+ mail (2.5.4)
44
+ mime-types (~> 1.16)
45
+ treetop (~> 1.4.8)
46
+ mime-types (1.25.1)
47
+ minitest (5.3.5)
48
+ multi_json (1.10.1)
49
+ polyglot (0.3.5)
50
+ rack (1.5.2)
51
+ rack-test (0.6.2)
52
+ rack (>= 1.0)
53
+ rails (4.1.1)
54
+ actionmailer (= 4.1.1)
55
+ actionpack (= 4.1.1)
56
+ actionview (= 4.1.1)
57
+ activemodel (= 4.1.1)
58
+ activerecord (= 4.1.1)
59
+ activesupport (= 4.1.1)
60
+ bundler (>= 1.3.0, < 2.0)
61
+ railties (= 4.1.1)
62
+ sprockets-rails (~> 2.0)
63
+ railties (4.1.1)
64
+ actionpack (= 4.1.1)
65
+ activesupport (= 4.1.1)
66
+ rake (>= 0.8.7)
67
+ thor (>= 0.18.1, < 2.0)
68
+ rake (10.3.2)
69
+ rspec (3.0.0)
70
+ rspec-core (~> 3.0.0)
71
+ rspec-expectations (~> 3.0.0)
72
+ rspec-mocks (~> 3.0.0)
73
+ rspec-core (3.0.1)
74
+ rspec-support (~> 3.0.0)
75
+ rspec-expectations (3.0.1)
76
+ diff-lcs (>= 1.2.0, < 2.0)
77
+ rspec-support (~> 3.0.0)
78
+ rspec-mocks (3.0.1)
79
+ rspec-support (~> 3.0.0)
80
+ rspec-support (3.0.0)
81
+ sprockets (2.12.1)
82
+ hike (~> 1.2)
83
+ multi_json (~> 1.0)
84
+ rack (~> 1.0)
85
+ tilt (~> 1.1, != 1.3.0)
86
+ sprockets-rails (2.1.3)
87
+ actionpack (>= 3.0)
88
+ activesupport (>= 3.0)
89
+ sprockets (~> 2.8)
90
+ thor (0.19.1)
91
+ thread_safe (0.3.4)
92
+ tilt (1.4.1)
93
+ treetop (1.4.15)
94
+ polyglot
95
+ polyglot (>= 0.3.1)
96
+ tzinfo (1.2.1)
97
+ thread_safe (~> 0.1)
98
+
99
+ PLATFORMS
100
+ ruby
101
+
102
+ DEPENDENCIES
103
+ foundation-rails-helpers!
104
+ rspec
@@ -0,0 +1,41 @@
1
+ # Foundation::Rails::Helpers
2
+
3
+ This gem is designed to provide an easy to use objected based approach to creating Zurb Foundation HTML elements using a elegant DSL.
4
+
5
+ Each helper object is available for direct use but they've been aliased for ease of use.
6
+
7
+ ## Usage
8
+
9
+ Here we have an example of creating a foundation panel using a clean DSL:
10
+
11
+ Foundation::Rails::Helpers::Panel.new do |panel|
12
+ panel.content = "Hello, World!"
13
+ panel.attributes[:class] = "callout"
14
+ end
15
+
16
+ Typing `Foundation::Rails::Helpers::xxx` will get rather tiresome so a view helper is provided:
17
+
18
+ foundation_panel do |panel|
19
+ panel.content = "Hello, World!"
20
+ panel.attributes[:class] = "callout"
21
+ end
22
+
23
+ If this is still a little long for you, you can optionally pass the arguments in instead of using block:
24
+
25
+ foundation_panel(content: "Hello World", attributes: { class: "callout" })
26
+
27
+ ## Support
28
+
29
+ Currently `Alert`, `Label`, and `Panel` have been implemented
30
+
31
+ ## Contributing
32
+
33
+ 1. Fork it
34
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
35
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
36
+ 4. Push to the branch (`git push origin my-new-feature`)
37
+ 5. Create new Pull Request
38
+
39
+ ## Resources
40
+
41
+ * [Foundation Docs](http://foundation.zurb.com/docs/)
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application.
3
+
4
+ ENGINE_ROOT = File.expand_path('../..', __FILE__)
5
+ ENGINE_PATH = File.expand_path('../../lib/foundation/rails/helpers/engine', __FILE__)
6
+
7
+ # Set up gems listed in the Gemfile.
8
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
9
+ require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
10
+
11
+ require 'rails/all'
12
+ require 'rails/engine/commands'
@@ -0,0 +1,22 @@
1
+ $:.push File.expand_path("../lib", __FILE__)
2
+
3
+ require "foundation/rails/helpers/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "foundation-rails-helpers"
7
+ s.version = Foundation::Rails::Helpers::VERSION
8
+ s.authors = ["Kyle Decot"]
9
+ s.email = ["kyle.decot@icloud.com"]
10
+ s.homepage = "http://www.github.com/kyledecot/foundation-rails-helpers"
11
+ s.summary = "Easily create Zurb Foundation objects using a DSL"
12
+ s.description = "This gem is designed to provide an easy to use objected based approach to creating Zurb Foundation HTML elements using a elegant DSL."
13
+ s.license = "MIT"
14
+
15
+ s.files = `git ls-files`.split($/)
16
+ s.test_files = s.files.grep(%r{^spec/})
17
+
18
+ s.add_dependency "rails", "> 4.0"
19
+
20
+ s.add_development_dependency "pry"
21
+ s.add_development_dependency "rspec"
22
+ end
@@ -1,6 +1,3 @@
1
1
  require "foundation/rails/helpers/engine"
2
2
 
3
- require "foundation/rails/helpers/element"
4
- require "foundation/rails/helpers/panel"
5
- require "foundation/rails/helpers/alert"
6
- require "foundation/rails/helpers/label"
3
+ %w[element panel alert label tooltip].each {|e| require "foundation/rails/helpers/#{e}" }
@@ -16,7 +16,7 @@ module Foundation
16
16
  # this ensures that dropdown buttons always get the basic classes they
17
17
  # need to display properly...
18
18
  #
19
- def attributes_merge(attributes = {}, defaults = {})
19
+ def attributes_merge(attributes = {}, defaults = {}, **other)
20
20
  mergeable = %i[class]
21
21
  attributes.merge(defaults) do |key, left, right|
22
22
  key.in?(mergeable) ? [left, right].join(' ') : left
@@ -0,0 +1,25 @@
1
+ module Foundation
2
+ module Rails
3
+ module Helpers
4
+ class Tooltip < Foundation::Rails::Helpers::Element
5
+
6
+ attr_accessor :title
7
+
8
+ def initialize(attributes: {}, content: nil, title: title)
9
+ @title = title
10
+ super(attributes: attributes, content: content)
11
+ end
12
+
13
+ private
14
+
15
+ def tag_type
16
+ :span
17
+ end
18
+
19
+ def default_attributes
20
+ { data: { tooltip: true }, class: ['has-tip'] }
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -1,7 +1,7 @@
1
1
  module Foundation
2
2
  module Rails
3
3
  module Helpers
4
- VERSION = "0.0.2"
4
+ VERSION = "0.0.3"
5
5
  end
6
6
  end
7
7
  end
@@ -0,0 +1,16 @@
1
+ # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile '~/.gitignore_global'
6
+
7
+ # Ignore bundler config.
8
+ /.bundle
9
+
10
+ # Ignore the default SQLite database.
11
+ /db/*.sqlite3
12
+ /db/*.sqlite3-journal
13
+
14
+ # Ignore all logfiles and tempfiles.
15
+ /log/*.log
16
+ /tmp
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foundation-rails-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Decot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-19 00:00:00.000000000 Z
11
+ date: 2014-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -60,9 +60,16 @@ executables: []
60
60
  extensions: []
61
61
  extra_rdoc_files: []
62
62
  files:
63
+ - ".gitignore"
64
+ - ".rspec"
65
+ - Gemfile
66
+ - Gemfile.lock
63
67
  - MIT-LICENSE
68
+ - README.md
64
69
  - Rakefile
65
70
  - app/helpers/foundation/rails/helpers/foundation_rails_helpers_application_helper.rb
71
+ - bin/rails
72
+ - foundation-rails-helpers.gemspec
66
73
  - lib/foundation-rails-helpers.rb
67
74
  - lib/foundation/rails/helpers.rb
68
75
  - lib/foundation/rails/helpers/alert.rb
@@ -70,19 +77,26 @@ files:
70
77
  - lib/foundation/rails/helpers/engine.rb
71
78
  - lib/foundation/rails/helpers/label.rb
72
79
  - lib/foundation/rails/helpers/panel.rb
80
+ - lib/foundation/rails/helpers/tooltip.rb
73
81
  - lib/foundation/rails/helpers/version.rb
74
82
  - spec/alert_spec.rb
83
+ - spec/dummy/.gitignore
75
84
  - spec/dummy/Gemfile
76
85
  - spec/dummy/Gemfile.lock
77
86
  - spec/dummy/README.rdoc
78
87
  - spec/dummy/Rakefile
88
+ - spec/dummy/app/assets/images/.keep
79
89
  - spec/dummy/app/assets/javascripts/application.js
80
90
  - spec/dummy/app/assets/stylesheets/application.css
81
91
  - spec/dummy/app/assets/stylesheets/foundation_and_overrides.scss
82
92
  - spec/dummy/app/controllers/application_controller.rb
93
+ - spec/dummy/app/controllers/concerns/.keep
83
94
  - spec/dummy/app/controllers/styleguide_controller.rb
84
95
  - spec/dummy/app/helpers/application_helper.rb
85
96
  - spec/dummy/app/helpers/styleguide_helper.rb
97
+ - spec/dummy/app/mailers/.keep
98
+ - spec/dummy/app/models/.keep
99
+ - spec/dummy/app/models/concerns/.keep
86
100
  - spec/dummy/app/views/layouts/application.html.erb
87
101
  - spec/dummy/app/views/styleguide/show.html.erb
88
102
  - spec/dummy/bin/bundle
@@ -106,17 +120,27 @@ files:
106
120
  - spec/dummy/config/locales/en.yml
107
121
  - spec/dummy/config/routes.rb
108
122
  - spec/dummy/db/seeds.rb
109
- - spec/dummy/log/development.log
123
+ - spec/dummy/lib/assets/.keep
124
+ - spec/dummy/lib/tasks/.keep
125
+ - spec/dummy/log/.keep
110
126
  - spec/dummy/public/404.html
111
127
  - spec/dummy/public/422.html
112
128
  - spec/dummy/public/500.html
113
129
  - spec/dummy/public/favicon.ico
114
130
  - spec/dummy/public/robots.txt
131
+ - spec/dummy/test/controllers/.keep
115
132
  - spec/dummy/test/controllers/styleguide_controller_test.rb
133
+ - spec/dummy/test/fixtures/.keep
134
+ - spec/dummy/test/helpers/.keep
116
135
  - spec/dummy/test/helpers/styleguide_helper_test.rb
136
+ - spec/dummy/test/integration/.keep
137
+ - spec/dummy/test/mailers/.keep
138
+ - spec/dummy/test/models/.keep
117
139
  - spec/dummy/test/test_helper.rb
140
+ - spec/dummy/vendor/assets/javascripts/.keep
141
+ - spec/dummy/vendor/assets/stylesheets/.keep
118
142
  - spec/spec_helper.rb
119
- homepage: http://www.kyledecot.com/
143
+ homepage: http://www.github.com/kyledecot/foundation-rails-helpers
120
144
  licenses:
121
145
  - MIT
122
146
  metadata: {}
@@ -142,18 +166,29 @@ specification_version: 4
142
166
  summary: Easily create Zurb Foundation objects using a DSL
143
167
  test_files:
144
168
  - spec/alert_spec.rb
169
+ - spec/dummy/.gitignore
170
+ - spec/dummy/Gemfile
171
+ - spec/dummy/Gemfile.lock
172
+ - spec/dummy/README.rdoc
173
+ - spec/dummy/Rakefile
174
+ - spec/dummy/app/assets/images/.keep
145
175
  - spec/dummy/app/assets/javascripts/application.js
146
176
  - spec/dummy/app/assets/stylesheets/application.css
147
177
  - spec/dummy/app/assets/stylesheets/foundation_and_overrides.scss
148
178
  - spec/dummy/app/controllers/application_controller.rb
179
+ - spec/dummy/app/controllers/concerns/.keep
149
180
  - spec/dummy/app/controllers/styleguide_controller.rb
150
181
  - spec/dummy/app/helpers/application_helper.rb
151
182
  - spec/dummy/app/helpers/styleguide_helper.rb
183
+ - spec/dummy/app/mailers/.keep
184
+ - spec/dummy/app/models/.keep
185
+ - spec/dummy/app/models/concerns/.keep
152
186
  - spec/dummy/app/views/layouts/application.html.erb
153
187
  - spec/dummy/app/views/styleguide/show.html.erb
154
188
  - spec/dummy/bin/bundle
155
189
  - spec/dummy/bin/rails
156
190
  - spec/dummy/bin/rake
191
+ - spec/dummy/config.ru
157
192
  - spec/dummy/config/application.rb
158
193
  - spec/dummy/config/boot.rb
159
194
  - spec/dummy/config/database.yml
@@ -170,19 +205,24 @@ test_files:
170
205
  - spec/dummy/config/initializers/wrap_parameters.rb
171
206
  - spec/dummy/config/locales/en.yml
172
207
  - spec/dummy/config/routes.rb
173
- - spec/dummy/config.ru
174
208
  - spec/dummy/db/seeds.rb
175
- - spec/dummy/Gemfile
176
- - spec/dummy/Gemfile.lock
177
- - spec/dummy/log/development.log
209
+ - spec/dummy/lib/assets/.keep
210
+ - spec/dummy/lib/tasks/.keep
211
+ - spec/dummy/log/.keep
178
212
  - spec/dummy/public/404.html
179
213
  - spec/dummy/public/422.html
180
214
  - spec/dummy/public/500.html
181
215
  - spec/dummy/public/favicon.ico
182
216
  - spec/dummy/public/robots.txt
183
- - spec/dummy/Rakefile
184
- - spec/dummy/README.rdoc
217
+ - spec/dummy/test/controllers/.keep
185
218
  - spec/dummy/test/controllers/styleguide_controller_test.rb
219
+ - spec/dummy/test/fixtures/.keep
220
+ - spec/dummy/test/helpers/.keep
186
221
  - spec/dummy/test/helpers/styleguide_helper_test.rb
222
+ - spec/dummy/test/integration/.keep
223
+ - spec/dummy/test/mailers/.keep
224
+ - spec/dummy/test/models/.keep
187
225
  - spec/dummy/test/test_helper.rb
226
+ - spec/dummy/vendor/assets/javascripts/.keep
227
+ - spec/dummy/vendor/assets/stylesheets/.keep
188
228
  - spec/spec_helper.rb