shipyard-framework 0.5.1 → 0.5.2

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: 012416749336816965f8232bd66ce83714e27efd
4
- data.tar.gz: 75d164a2deb0985740166e01efa83851a7f4409c
3
+ metadata.gz: 4583619f521de770f88cc5a90546c0be4176ddf5
4
+ data.tar.gz: 00e8b03081f2ea05bfbaf8b0a84870772f1694d2
5
5
  SHA512:
6
- metadata.gz: 95a4fa016cd9f1bbd0be6a71399286e3ff456e4c73112f5acc3b37b3fbc9a1dcaa19a215b6139420815672df2edb43d3e751f7f580db7c23c953c207774260df
7
- data.tar.gz: e4df0db55dca161de2a38dd16fcfad5cd50d1b338e65cfe3f6d0d80281af2831c121ab5778a168f311b46c58c43b680e83489bc38c834e26f4ac2cd9b7e3711e
6
+ metadata.gz: d4906eb002f3bf282fd0d81a208c09eeddf09b80f57c21da1c4138e7637075b42346931be07f1ce1bded9d27b7111128f942e7ece72f6b1803ee427b4181738d
7
+ data.tar.gz: 4edd1a39ce05f5777bc029a194998fe867bc07f22f9e068d2fcb57e42a68c13125d1a922b633bcc5a1c0bc8df454bf2547eb66417e487118f095c7ce9c0cbb3b
data/.rspec CHANGED
@@ -1,2 +1,3 @@
1
1
  --format documentation
2
- --color
2
+ --color
3
+ --require spec_helper
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.4.1
data/README.md CHANGED
@@ -32,6 +32,10 @@ plugins:
32
32
  - shipyard-framework
33
33
  ```
34
34
 
35
+ ## Status
36
+ [![Gem Version](https://badge.fury.io/rb/shipyard-framework.svg)](https://badge.fury.io/rb/shipyard-framework)
37
+ [![Codeship Status for shipyard-framework/shipyard](https://app.codeship.com/projects/a1a079a0-800a-0135-2025-3e18bae1bf89/status?branch=master)](https://app.codeship.com/projects/246583)
38
+
35
39
  ## Usage
36
40
 
37
41
  TODO: Write usage instructions here
@@ -46,7 +50,6 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
46
50
 
47
51
  Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/shipyard. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
48
52
 
49
-
50
53
  ## License
51
54
 
52
55
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -23,7 +23,7 @@ module Shipyard
23
23
  end
24
24
  end
25
25
 
26
- options[:class] = "#{class_list.join(' ')} #{options[:class]}"
26
+ options[:class] = "#{class_list.join(' ')} #{options[:class]}".strip
27
27
 
28
28
  content_tag :div, options do
29
29
  concat content_tag(:p, raw(alert_txt), class: 'alert-txt')
@@ -1,6 +1,7 @@
1
1
  module Shipyard
2
2
  module ButtonHelper
3
3
  include ActionView::Helpers::TagHelper
4
+ include ActionView::Helpers::UrlHelper
4
5
 
5
6
  def btn(text, *args, &block)
6
7
  if block_given?
@@ -1,14 +1,19 @@
1
1
  module Shipyard
2
2
  module FormHelper
3
+ include ActionView::Context
4
+ include ActionView::Helpers::FormTagHelper
5
+ include ActionView::Helpers::FormOptionsHelper
6
+
3
7
  def input_text(name, value=nil, options={})
4
- options[:class] = "input input-text #{options[:class]}"
8
+ options[:class] = "input input-text #{options[:class]}".strip
5
9
  text_field_tag name, value, options
6
10
  end
7
11
 
8
12
  def input_select_tag(name, choices, container_options={}, select_options={})
9
- container_options[:class] = "input-select-container #{container_options[:class]}"
13
+ container_options[:class] = "input-select-container #{container_options[:class]}".strip
10
14
  content_tag :div, container_options do
11
- select_options[:class] = "input input-select #{select_options[:class]}"
15
+ select_options[:class] = "input input-select #{select_options[:class]}".strip
16
+ choices = options_for_select(choices) if choices.is_a? Array
12
17
  select_tag name, choices, select_options
13
18
  end
14
19
  end
@@ -12,6 +12,7 @@ module Shipyard
12
12
  register_jekyll_tags
13
13
  end
14
14
 
15
+ register_helpers
15
16
  configure_sass
16
17
  end
17
18
 
@@ -52,7 +53,6 @@ module Shipyard
52
53
 
53
54
  def configure_sass
54
55
  require 'sass'
55
-
56
56
  ::Sass.load_paths << stylesheets_path
57
57
  end
58
58
 
@@ -79,6 +79,12 @@ module Shipyard
79
79
  Liquid::Template.register_tag('alert', Shipyard::Jekyll::Alert)
80
80
  Liquid::Template.register_tag('shipyard_version', Shipyard::Jekyll::ShipyardVersion)
81
81
  end
82
+
83
+ def register_helpers
84
+ Dir['app/helpers/shipyard/*.rb'].each do |file|
85
+ require_relative "../#{file}"
86
+ end
87
+ end
82
88
  end
83
89
  end
84
90
 
@@ -1,3 +1,3 @@
1
1
  module Shipyard
2
- VERSION = '0.5.1'
2
+ VERSION = '0.5.2'
3
3
  end
data/shipyard.gemspec CHANGED
@@ -17,7 +17,9 @@ Gem::Specification.new do |spec|
17
17
  # spec.add_runtime_dependency 'sassc', '~> 1.11.4'
18
18
  spec.add_runtime_dependency 'actionview', '~> 5.0'
19
19
 
20
- spec.add_development_dependency 'bundler', '~> 1.15', '>= 1.15.3'
20
+ spec.add_development_dependency 'bundler', '~> 1.15'
21
+ spec.add_development_dependency 'sass', '~> 3.5', '>= 3.5.1'
22
+ spec.add_development_dependency 'rspec', '~> 3.6'
21
23
 
22
24
  spec.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
23
25
  spec.files = `git ls-files`.split("\n")
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe Shipyard::AlertHelper, type: :helper do
4
+ include Shipyard::AlertHelper
5
+
6
+ it 'should return a default alert' do
7
+ expect(flash_alert { 'test' }).to match(
8
+ %r{<div role="alert" data-shipyard="alert" v-show="visible" class="alert"><p class="alert-txt">test</p></div>}
9
+ )
10
+ end
11
+
12
+ it 'should return all alert types' do
13
+ %w(info success warning error).each do |type|
14
+ expect(flash_alert(type.to_sym) { type }).to match(
15
+ %r{<div role="alert" data-shipyard="alert" v-show="visible" class="alert alert-#{type}"><p class="alert-txt">#{type}</p></div>}
16
+ )
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,21 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe Shipyard::BoxHelper, type: :helper do
4
+ include Shipyard::BoxHelper
5
+
6
+ xit 'should return a default box' do
7
+ expect(box { 'test' }).to match(%r{<div class="box">test</div>})
8
+ end
9
+
10
+ it 'should return all box types' do
11
+ %w(secondary padding link).each do |type|
12
+ expect(box([type.to_sym], 'test')).to match(%r{<div class="box box-#{type}">test</div>})
13
+ end
14
+ end
15
+
16
+ it 'should return all box sizes' do
17
+ %w(xxs xs sm md lg xl).each do |size|
18
+ expect(box([size.to_sym], 'test')).to match(%r{<div class="box box-#{size}">test</div>})
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,37 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe Shipyard::ButtonHelper, type: :helper do
4
+ include Shipyard::ButtonHelper
5
+
6
+ it 'should return a default button' do
7
+ expect(btn('Save')).to match(%r{<button class="btn">Save</button>})
8
+ end
9
+
10
+ it 'should return all other button types' do
11
+ %w(primary secondary disabled cta caution inverse inverse-secondary).each do |type|
12
+ expect(btn('Save', type.to_sym)).to match(%r{<button class="btn btn-#{type}">Save</button>})
13
+ end
14
+ end
15
+
16
+ it 'should return a linked button' do
17
+ expect(btn('Save', href: '#')).to match(%r{<a href="#" role="button" class="btn">Save</a>})
18
+ end
19
+
20
+ it 'should return a button with a custom data attribute' do
21
+ expect(btn('Save', data: { btn_type: 'save' })).to match(%r{<button data-btn-type="save" class="btn">Save</button>})
22
+ end
23
+
24
+ it 'should return a button with a custom CSS class' do
25
+ expect(btn('Save', class: 'shipyard-cta')).to match(%r{<button class="shipyard-cta btn">Save</button>})
26
+ end
27
+
28
+ it 'should return all button sizes' do
29
+ %w(xxs xs sm md lg xl).each do |size|
30
+ expect(btn('Save', size.to_sym)).to match(%r{<button class="btn btn-#{size}">Save</button>})
31
+ end
32
+ end
33
+
34
+ it 'should return a responsive button' do
35
+ expect(btn('Save', :xs, :x1_md)).to match(%r{<button class="btn btn-xs btn-x1-md">Save</button>})
36
+ end
37
+ end
@@ -0,0 +1,29 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe Shipyard::FormHelper, type: :helper do
4
+ include Shipyard::FormHelper
5
+
6
+ it 'should return a text box' do
7
+ expect(input_text(:organization, 'Shipyard')).to(
8
+ match(%r{<input type="text" name="organization" id="organization" value="Shipyard" class="input input-text" />})
9
+ )
10
+ end
11
+
12
+ it 'should return a text box with a custom CSS class' do
13
+ expect(input_text(:organization, 'Shipyard', class: 'shipyard-input')).to(
14
+ match(%r{<input type="text" name="organization" id="organization" value="Shipyard" class="input input-text shipyard-input" />})
15
+ )
16
+ end
17
+
18
+ it 'should return a select box' do
19
+ expect(input_select_tag(:organization, %w(HTML CSS JavaScript))).to(
20
+ match(%r{<div class="input-select-container"><select name="organization" id="organization" class="input input-select"><option value="HTML">HTML</option>\n<option value="CSS">CSS</option>\n<option value="JavaScript">JavaScript</option></select></div>})
21
+ )
22
+ end
23
+
24
+ it 'should return a select box wth a custom CSS class' do
25
+ expect(input_select_tag(:organization, %w(HTML CSS JavaScript), class: 'shipyard-select')).to(
26
+ match(%r{<div class="input-select-container shipyard-select"><select name="organization" id="organization" class="input input-select"><option value="HTML">HTML</option>\n<option value="CSS">CSS</option>\n<option value="JavaScript">JavaScript</option></select></div>})
27
+ )
28
+ end
29
+ end
@@ -0,0 +1,21 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe Shipyard::IconHelper, type: :helper do
4
+ include Shipyard::IconHelper
5
+
6
+ xit 'should return an svg gear icon with the svg use tag.' do
7
+ expect(icon(:gear)).to match(/<svg class="icon icon-gear icon-outline"(.+?)><use(.+?)>/)
8
+ end
9
+
10
+ xit 'should return an svg fear icon without the svg use tag.' do
11
+ expect(icon('gear')).to match(/<svg class="icon icon-gear icon-outline"(.+?)>/)
12
+ end
13
+
14
+ xit 'should return an svg logo icon with a prefixed class name' do
15
+ expect(icon(:gear, prefix: 'header')).to match(/<svg class="icon icon-gear icon-outline header-icon header-icon-gear" (.+?)><use(.+?)>/)
16
+ end
17
+
18
+ xit 'should return an svg logo icon with a custom CSS class' do
19
+ expect(icon(:logo, class: 'shipyard-icon')).to match(/<svg class="icon icon-gear icon-outline shipyard-icon" (.+?)><use(.+?)>/)
20
+ end
21
+ end
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe Shipyard::NoteHelper, type: :helper do
4
+ include Shipyard::NoteHelper
5
+
6
+ it 'should return a default note' do
7
+ expect(note nil, 'test').to match(
8
+ %r{<div class="note">test</div>}
9
+ )
10
+ end
11
+
12
+ it 'should return all note types' do
13
+ %w(info success warning error).each do |type|
14
+ expect(note(type, 'test')).to match(
15
+ %r{<div class="note note-#{type}">test</div>}
16
+ )
17
+ end
18
+ end
19
+ end
@@ -1,11 +1,7 @@
1
- require "spec_helper"
1
+ require 'spec_helper'
2
2
 
3
3
  describe Shipyard do
4
- it "has a version number" do
4
+ it 'has a version number' do
5
5
  expect(Shipyard::VERSION).not_to be nil
6
6
  end
7
-
8
- it "does something useful" do
9
- expect(false).to eq(true)
10
- end
11
7
  end
data/spec/spec_helper.rb CHANGED
@@ -1,2 +1,104 @@
1
- $LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
2
- require "shipyard"
1
+ require 'bundler/setup'
2
+ require 'shipyard-framework'
3
+ Bundler.setup
4
+
5
+ # This file was generated by the `rspec --init` command. Conventionally, all
6
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
7
+ # The generated `.rspec` file contains `--require spec_helper` which will cause
8
+ # this file to always be loaded, without a need to explicitly require it in any
9
+ # files.
10
+ #
11
+ # Given that it is always loaded, you are encouraged to keep this file as
12
+ # light-weight as possible. Requiring heavyweight dependencies from this file
13
+ # will add to the boot time of your test suite on EVERY test run, even for an
14
+ # individual file that may not need all of that loaded. Instead, consider making
15
+ # a separate helper file that requires the additional dependencies and performs
16
+ # the additional setup, and require it from the spec files that actually need
17
+ # it.
18
+ #
19
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
20
+ RSpec.configure do |config|
21
+ # rspec-expectations config goes here. You can use an alternate
22
+ # assertion/expectation library such as wrong or the stdlib/minitest
23
+ # assertions if you prefer.
24
+ config.expect_with :rspec do |expectations|
25
+ # This option will default to `true` in RSpec 4. It makes the `description`
26
+ # and `failure_message` of custom matchers include text for helper methods
27
+ # defined using `chain`, e.g.:
28
+ # be_bigger_than(2).and_smaller_than(4).description
29
+ # # => "be bigger than 2 and smaller than 4"
30
+ # ...rather than:
31
+ # # => "be bigger than 2"
32
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
33
+ end
34
+
35
+ # rspec-mocks config goes here. You can use an alternate test double
36
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
37
+ config.mock_with :rspec do |mocks|
38
+ # Prevents you from mocking or stubbing a method that does not exist on
39
+ # a real object. This is generally recommended, and will default to
40
+ # `true` in RSpec 4.
41
+ mocks.verify_partial_doubles = true
42
+ end
43
+
44
+ # This option will default to `:apply_to_host_groups` in RSpec 4 (and will
45
+ # have no way to turn it off -- the option exists only for backwards
46
+ # compatibility in RSpec 3). It causes shared context metadata to be
47
+ # inherited by the metadata hash of host groups and examples, rather than
48
+ # triggering implicit auto-inclusion in groups with matching metadata.
49
+ config.shared_context_metadata_behavior = :apply_to_host_groups
50
+
51
+ # The settings below are suggested to provide a good initial experience
52
+ # with RSpec, but feel free to customize to your heart's content.
53
+ =begin
54
+ # This allows you to limit a spec run to individual examples or groups
55
+ # you care about by tagging them with `:focus` metadata. When nothing
56
+ # is tagged with `:focus`, all examples get run. RSpec also provides
57
+ # aliases for `it`, `describe`, and `context` that include `:focus`
58
+ # metadata: `fit`, `fdescribe` and `fcontext`, respectively.
59
+ config.filter_run_when_matching :focus
60
+
61
+ # Allows RSpec to persist some state between runs in order to support
62
+ # the `--only-failures` and `--next-failure` CLI options. We recommend
63
+ # you configure your source control system to ignore this file.
64
+ config.example_status_persistence_file_path = "spec/examples.txt"
65
+
66
+ # Limits the available syntax to the non-monkey patched syntax that is
67
+ # recommended. For more details, see:
68
+ # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
69
+ # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
70
+ # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
71
+ config.disable_monkey_patching!
72
+
73
+ # This setting enables warnings. It's recommended, but in some cases may
74
+ # be too noisy due to issues in dependencies.
75
+ config.warnings = true
76
+
77
+ # Many RSpec users commonly either run the entire suite or an individual
78
+ # file, and it's useful to allow more verbose output when running an
79
+ # individual spec file.
80
+ if config.files_to_run.one?
81
+ # Use the documentation formatter for detailed output,
82
+ # unless a formatter has already been configured
83
+ # (e.g. via a command-line flag).
84
+ config.default_formatter = "doc"
85
+ end
86
+
87
+ # Print the 10 slowest examples and example groups at the
88
+ # end of the spec run, to help surface which specs are running
89
+ # particularly slow.
90
+ config.profile_examples = 10
91
+
92
+ # Run specs in random order to surface order dependencies. If you find an
93
+ # order dependency and want to debug it, you can fix the order by providing
94
+ # the seed, which is printed after each run.
95
+ # --seed 1234
96
+ config.order = :random
97
+
98
+ # Seed global randomization in this process using the `--seed` CLI option.
99
+ # Setting this allows you to use `--seed` to deterministically reproduce
100
+ # test failures related to randomization by passing the same `--seed` value
101
+ # as the one that triggered the failure.
102
+ Kernel.srand config.seed
103
+ =end
104
+ end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- shipyard-framework (0.5.1)
4
+ shipyard-framework (0.5.2)
5
5
  actionview (~> 5.0)
6
6
 
7
7
  GEM
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shipyard-framework
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shipyard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-13 00:00:00.000000000 Z
11
+ date: 2017-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview
@@ -31,19 +31,47 @@ dependencies:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.15'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.15'
41
+ - !ruby/object:Gem::Dependency
42
+ name: sass
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.5'
34
48
  - - ">="
35
49
  - !ruby/object:Gem::Version
36
- version: 1.15.3
50
+ version: 3.5.1
37
51
  type: :development
38
52
  prerelease: false
39
53
  version_requirements: !ruby/object:Gem::Requirement
40
54
  requirements:
41
55
  - - "~>"
42
56
  - !ruby/object:Gem::Version
43
- version: '1.15'
57
+ version: '3.5'
44
58
  - - ">="
45
59
  - !ruby/object:Gem::Version
46
- version: 1.15.3
60
+ version: 3.5.1
61
+ - !ruby/object:Gem::Dependency
62
+ name: rspec
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '3.6'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '3.6'
47
75
  description:
48
76
  email:
49
77
  - ryanwilke@gmail.com
@@ -53,6 +81,7 @@ extra_rdoc_files: []
53
81
  files:
54
82
  - ".gitignore"
55
83
  - ".rspec"
84
+ - ".ruby-version"
56
85
  - CODE_OF_CONDUCT.md
57
86
  - Gemfile
58
87
  - LICENSE.txt
@@ -143,6 +172,12 @@ files:
143
172
  - lib/shipyard-framework/rails/railtie.rb
144
173
  - lib/shipyard-framework/version.rb
145
174
  - shipyard.gemspec
175
+ - spec/helpers/alert_helper_spec.rb
176
+ - spec/helpers/box_helper_spec.rb
177
+ - spec/helpers/button_helper_spec.rb
178
+ - spec/helpers/form_helper_spec.rb
179
+ - spec/helpers/icon_helper_spec.rb
180
+ - spec/helpers/note_helper_spec.rb
146
181
  - spec/shipyard_spec.rb
147
182
  - spec/spec_helper.rb
148
183
  - styleguide/.gitignore
@@ -191,7 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
191
226
  version: '0'
192
227
  requirements: []
193
228
  rubyforge_project:
194
- rubygems_version: 2.5.1
229
+ rubygems_version: 2.6.11
195
230
  signing_key:
196
231
  specification_version: 4
197
232
  summary: A lightweight CSS framework for developing mobile-first projects in Ruby