shipyard-framework 0.2.9 → 0.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: 7ae8d55154badaa5fc99bd664d6c9ca0d16024d1
4
- data.tar.gz: da8a73305d20fa6fad7993cb6483a8ca753cb99e
3
+ metadata.gz: 99e749ccd1dbf24d1f45e0d6f603322bcea18e27
4
+ data.tar.gz: a9cc03511cda2d5c3451d773f67a015795902b98
5
5
  SHA512:
6
- metadata.gz: cfaacc56f04a26d05f322927bd7ddeb541c3c856a9bfa0f52216107c52a1d0fed18b800f3ba898fd7433a0b50231f1f1f6968473c64bd693a8da0b27d84f513d
7
- data.tar.gz: 69cadf09ce52200b0ed2d4d4c6a8fb871711a00251754ff1dab8f5c63166928870a358886f6f40f0f423475e9bb9538efc317b2a475f0084c2966d9f039c5552
6
+ metadata.gz: 1b91ab19727beeb480981e88b0e3ecb28fded9567bcd5c478a14028c9d5906018e9b04b9eafac8e3a5bdd3fbf060aeb615c46f459b0f3c105732b4238580807b
7
+ data.tar.gz: 5be356cc63978811a28c060395935feee7edfeeb9f4140f232e1110280ede22b6292d2955d7e5fc88db65009d1fa7845e7823e98e7b779568a202a1b149caae8
@@ -1,4 +1,5 @@
1
1
  require 'shipyard-framework/version'
2
+ require 'action_view'
2
3
 
3
4
  module Shipyard
4
5
  class << self
@@ -7,6 +8,8 @@ module Shipyard
7
8
  register_rails_engine
8
9
  elsif sprockets?
9
10
  register_sprockets
11
+ elsif jekyll?
12
+ register_jekyll_tags
10
13
  end
11
14
 
12
15
  configure_sass
@@ -43,6 +46,10 @@ module Shipyard
43
46
  defined?(::Rails)
44
47
  end
45
48
 
49
+ def jekyll?
50
+ defined?(::Jekyll) && defined?(::Liquid)
51
+ end
52
+
46
53
  def configure_sass
47
54
  require 'sass'
48
55
 
@@ -59,6 +66,11 @@ module Shipyard
59
66
  Sprockets.append_path(stylesheets_path)
60
67
  Sprockets.append_path(javascripts_path)
61
68
  end
69
+
70
+ def register_jekyll_tags
71
+ require 'shipyard-framework/jekyll/button_helper'
72
+ Liquid::Template.register_tag('btn', Shipyard::Jekyll::Button)
73
+ end
62
74
  end
63
75
  end
64
76
 
@@ -0,0 +1,21 @@
1
+ require 'shipyard-framework/rails/button_helper'
2
+
3
+ module Shipyard
4
+ module Jekyll
5
+ class Button < Liquid::Tag
6
+ include Shipyard::Rails::ButtonHelper
7
+
8
+ def initialize(tag_name, params, options)
9
+ super
10
+ @params = params.split(',')
11
+ @text = @params[0]
12
+ @args = @params[1].to_s.tr(':','').split(' ').map(&:to_sym)
13
+ @args << eval("{#{@params[2]}}") if @params[2]
14
+ end
15
+
16
+ def render(context)
17
+ btn @text, *@args
18
+ end
19
+ end
20
+ end
21
+ end
@@ -1,9 +1,11 @@
1
1
  module Shipyard
2
2
  module Rails
3
3
  module ButtonHelper
4
- def btn(name, *args, &block)
4
+ include ActionView::Helpers::TagHelper
5
+
6
+ def btn(text, *args, &block)
5
7
  if block_given?
6
- args << name
8
+ args << text
7
9
  name = capture(&block)
8
10
  end
9
11
 
@@ -14,11 +16,8 @@ module Shipyard
14
16
  end
15
17
 
16
18
  # Output the appropriate button.
17
- if options.key?(:href)
18
- link_to name, options[:href], btn_options(args, options)
19
- else
20
- content_tag :button, name, btn_options(args, options)
21
- end
19
+ tag = options.key?(:href) ? :a : :button
20
+ content_tag tag, text, btn_options(args, options)
22
21
  end
23
22
 
24
23
  private
@@ -30,7 +29,7 @@ module Shipyard
30
29
  options[:class] += " btn-#{arg.to_s.tr('_', '-')}" if arg.is_a?(Symbol)
31
30
  end
32
31
  options[:class].strip!
33
- options.except(:href)
32
+ options
34
33
  end
35
34
  end
36
35
  end
@@ -1,3 +1,3 @@
1
1
  module Shipyard
2
- VERSION = '0.2.9'
2
+ VERSION = '0.3.0'
3
3
  end
data/shipyard.gemspec CHANGED
@@ -15,6 +15,7 @@ Gem::Specification.new do |spec|
15
15
  # spec.add_runtime_dependency 'sassc-rails', '~> 1.3', '>= 1.3.0'
16
16
  # spec.add_runtime_dependency 'slim-rails', '~> 3.1', '>= 3.1.0'
17
17
  # spec.add_runtime_dependency 'sassc', '~> 1.11.4'
18
+ spec.add_runtime_dependency 'actionview'
18
19
 
19
20
  spec.add_development_dependency 'bundler', '~> 1.15', '>= 1.15.3'
20
21
 
metadata CHANGED
@@ -1,33 +1,47 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shipyard-framework
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shipyard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-03 00:00:00.000000000 Z
11
+ date: 2017-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: actionview
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: bundler
15
29
  requirement: !ruby/object:Gem::Requirement
16
30
  requirements:
17
- - - "~>"
31
+ - - ~>
18
32
  - !ruby/object:Gem::Version
19
33
  version: '1.15'
20
- - - ">="
34
+ - - '>='
21
35
  - !ruby/object:Gem::Version
22
36
  version: 1.15.3
23
37
  type: :development
24
38
  prerelease: false
25
39
  version_requirements: !ruby/object:Gem::Requirement
26
40
  requirements:
27
- - - "~>"
41
+ - - ~>
28
42
  - !ruby/object:Gem::Version
29
43
  version: '1.15'
30
- - - ">="
44
+ - - '>='
31
45
  - !ruby/object:Gem::Version
32
46
  version: 1.15.3
33
47
  description:
@@ -37,8 +51,8 @@ executables: []
37
51
  extensions: []
38
52
  extra_rdoc_files: []
39
53
  files:
40
- - ".gitignore"
41
- - ".rspec"
54
+ - .gitignore
55
+ - .rspec
42
56
  - CODE_OF_CONDUCT.md
43
57
  - Gemfile
44
58
  - LICENSE.txt
@@ -105,6 +119,7 @@ files:
105
119
  - assets/stylesheets/shipyard/variables/_typography.scss
106
120
  - lib/shipyard-framework.rb
107
121
  - lib/shipyard-framework/icons.rb
122
+ - lib/shipyard-framework/jekyll/button_helper.rb
108
123
  - lib/shipyard-framework/rails/alert_helper.rb
109
124
  - lib/shipyard-framework/rails/button_helper.rb
110
125
  - lib/shipyard-framework/rails/engine.rb
@@ -126,17 +141,17 @@ require_paths:
126
141
  - lib
127
142
  required_ruby_version: !ruby/object:Gem::Requirement
128
143
  requirements:
129
- - - ">="
144
+ - - '>='
130
145
  - !ruby/object:Gem::Version
131
146
  version: '0'
132
147
  required_rubygems_version: !ruby/object:Gem::Requirement
133
148
  requirements:
134
- - - ">="
149
+ - - '>='
135
150
  - !ruby/object:Gem::Version
136
151
  version: '0'
137
152
  requirements: []
138
153
  rubyforge_project:
139
- rubygems_version: 2.5.1
154
+ rubygems_version: 2.0.14.1
140
155
  signing_key:
141
156
  specification_version: 4
142
157
  summary: A lightweight CSS framework for developing mobile-first projects in Ruby