amber_component 0.0.3 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/.solargraph.yml +1 -2
  3. data/CONTRIBUTING.md +2 -2
  4. data/Gemfile +1 -1
  5. data/Gemfile.lock +12 -12
  6. data/README.md +327 -4
  7. data/lib/amber_component/base.rb +31 -12
  8. data/lib/amber_component/helpers/component_helper.rb +1 -0
  9. data/lib/amber_component/minitest_test_case.rb +10 -0
  10. data/lib/amber_component/prop_definition.rb +54 -0
  11. data/lib/amber_component/props.rb +111 -0
  12. data/lib/amber_component/test_helper.rb +34 -0
  13. data/lib/amber_component/typed_content.rb +3 -3
  14. data/lib/amber_component/version.rb +1 -1
  15. data/lib/amber_component/views.rb +4 -4
  16. data/lib/amber_component.rb +8 -9
  17. data/lib/generators/amber_component/install_generator.rb +20 -1
  18. data/lib/generators/amber_component/templates/application_component_test_case.rb +7 -0
  19. data/lib/generators/amber_component_generator.rb +56 -4
  20. data/lib/generators/component_generator.rb +9 -0
  21. data/lib/generators/templates/component.rb.erb +3 -1
  22. data/lib/generators/templates/component_test.rb.erb +11 -3
  23. data/lib/generators/templates/style.css.erb +1 -1
  24. data/lib/generators/templates/style.sass.erb +3 -0
  25. data/lib/generators/templates/style.scss.erb +5 -0
  26. data/lib/generators/templates/view.haml.erb +9 -0
  27. data/lib/generators/templates/view.html.erb.erb +8 -0
  28. data/lib/generators/templates/view.slim.erb +6 -0
  29. metadata +13 -31
  30. data/docs/.bundle/config +0 -2
  31. data/docs/.gitignore +0 -5
  32. data/docs/404.html +0 -25
  33. data/docs/Gemfile +0 -37
  34. data/docs/Gemfile.lock +0 -89
  35. data/docs/README.md +0 -19
  36. data/docs/_config.yml +0 -148
  37. data/docs/_data/amber_component.yml +0 -3
  38. data/docs/_sass/_variables.scss +0 -2
  39. data/docs/_sass/color_schemes/amber_component.scss +0 -11
  40. data/docs/_sass/custom/custom.scss +0 -60
  41. data/docs/api/index.md +0 -8
  42. data/docs/assets/images/logo_wide.png +0 -0
  43. data/docs/changelog/index.md +0 -8
  44. data/docs/favicon.ico +0 -0
  45. data/docs/getting_started/index.md +0 -8
  46. data/docs/getting_started/installation.md +0 -7
  47. data/docs/getting_started/ruby_support.md +0 -7
  48. data/docs/getting_started/wireframes.md +0 -7
  49. data/docs/index.md +0 -17
  50. data/docs/introduction/basic_usage.md +0 -7
  51. data/docs/introduction/index.md +0 -8
  52. data/docs/introduction/why_amber_component.md +0 -7
  53. data/docs/resources/index.md +0 -8
  54. data/docs/styles/index.md +0 -8
  55. data/docs/styles/usage.md +0 -7
  56. data/docs/views/index.md +0 -8
  57. data/docs/views/usage.md +0 -7
  58. data/lib/generators/templates/view.html.erb +0 -3
@@ -0,0 +1,111 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'prop_definition'
4
+
5
+ module ::AmberComponent
6
+ # Provides a DSL for defining component
7
+ # properties.
8
+ module Props
9
+ # Class methods for component properties.
10
+ module ClassMethods
11
+ # @return [Hash{Symbol => AmberComponent::Prop}]
12
+ attr_reader :prop_definitions
13
+
14
+ # @param names [Array<Symbol>]
15
+ # @param type [Class, nil]
16
+ # @param required [Boolean]
17
+ # @param default [Object, Proc, nil]
18
+ # @param allow_nil [Boolean]
19
+ def prop(*names, type: nil, required: false, default: nil, allow_nil: false)
20
+ @prop_definitions ||= {}
21
+ include(@prop_methods_module = ::Module.new) if @prop_methods_module.nil?
22
+
23
+ names.each do |name|
24
+ @prop_definitions[name] = prop_def = PropDefinition.new(
25
+ name: name,
26
+ type: type,
27
+ required: required,
28
+ default: default,
29
+ allow_nil: allow_nil
30
+ )
31
+ raise IncorrectPropTypeError, <<~MSG unless type.nil? || type.is_a?(::Class)
32
+ `type` should be a class but received `#{type.inspect}` (`#{type.class}`)
33
+ MSG
34
+
35
+ @prop_methods_module.attr_reader name
36
+ next @prop_methods_module.attr_writer(name) unless prop_def.type?
37
+
38
+ @prop_methods_module.class_eval( # rubocop:disable Style/DocumentDynamicEvalDefinition
39
+ # def phone=(val)
40
+ # raise IncorrectPropTypeError, <<~MSG unless val.nil? || val.is_a?(String)
41
+ # #{self.class} received `#{val.class}` instead of `String` for `phone` prop
42
+ # MSG
43
+ #
44
+ # @phone = val
45
+ # end
46
+ <<~RUB, __FILE__, __LINE__ + 1
47
+ def #{name}=(val)
48
+ raise IncorrectPropTypeError, <<~MSG unless #{allow_nil ? 'val.nil? ||' : nil} val.is_a?(#{prop_def.type})
49
+ \#{self.class} received `\#{val.class}` instead of `#{prop_def.type}` for `#{name}` prop
50
+ MSG
51
+
52
+ @#{name} = val
53
+ end
54
+ RUB
55
+ ) # rubocop:disable Layout/HeredocArgumentClosingParenthesis
56
+ end
57
+ end
58
+
59
+ # @return [Array<Symbol>, nil]
60
+ def prop_names
61
+ @prop_definitions.keys
62
+ end
63
+
64
+ # @return [Array<Symbol>, nil]
65
+ def required_prop_names
66
+ @prop_definitions&.filter_map do |name, prop_def|
67
+ next unless prop_def.required
68
+
69
+ name
70
+ end
71
+ end
72
+ end
73
+
74
+ # Instance methods for component properties.
75
+ module InstanceMethods
76
+ private
77
+
78
+ # @param props [Hash{Symbol => Object}]
79
+ def initialize(**kwargs)
80
+ bind_props(kwargs)
81
+ end
82
+
83
+ # @param props [Hash{Symbol => Object}]
84
+ # @return [Boolean] `false` when there are no props defined on the class
85
+ # and `true` otherwise
86
+ # @raise [AmberComponent::MissingPropsError] when required props are missing
87
+ # @raise [AmberComponent::IncorrectPropTypeError]
88
+ def bind_props(props)
89
+ return false if self.class.prop_definitions.nil?
90
+
91
+ self.class.prop_definitions.each do |name, prop_def|
92
+ setter_name = :"#{name}="
93
+ public_send(setter_name, prop_def.default!) if prop_def.default?
94
+
95
+ prop_present = props.include? name
96
+
97
+ raise MissingPropsError, <<~MSG if prop_def.required? && !prop_present
98
+ `#{self.class}` has a missing required prop: `#{name.inspect}`
99
+ MSG
100
+
101
+ next unless prop_present
102
+
103
+ value = props[name]
104
+ public_send(setter_name, value)
105
+ end
106
+
107
+ true
108
+ end
109
+ end
110
+ end
111
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AmberComponent
4
+ # Provides assertions for the rendered
5
+ # HTML of components.
6
+ module TestHelper
7
+ begin
8
+ require 'capybara/minitest'
9
+ include ::Capybara::Minitest::Assertions
10
+
11
+ def page
12
+ @page ||= ::Capybara::Node::Simple.new(@rendered_content)
13
+ end
14
+ rescue ::LoadError
15
+ nil
16
+ end
17
+
18
+ # @return [Nokogiri::HTML]
19
+ def document
20
+ ::Nokogiri::HTML.fragment(@rendered_content)
21
+ end
22
+ alias doc document
23
+ alias html document
24
+
25
+ # @param content [String]
26
+ # @return [Nokogiri::HTML]
27
+ def render(content = nil)
28
+ @page = nil
29
+ @rendered_content = content || yield
30
+ document
31
+ end
32
+ alias render_inline render
33
+ end
34
+ end
@@ -9,9 +9,9 @@ module ::AmberComponent
9
9
  def wrap(val)
10
10
  return val if val.is_a?(self)
11
11
 
12
- unless val.respond_to?(:[])
13
- raise InvalidType, "`TypedContent` should be a `Hash` or `#{self}` but was `#{val.class}` (#{val.inspect})"
14
- end
12
+ raise InvalidTypeError, <<~MSG unless val.respond_to?(:[])
13
+ `TypedContent` should be a `Hash` or `#{self}` but was `#{val.class}` (#{val.inspect})
14
+ MSG
15
15
 
16
16
  new(type: val[:type], content: val[:content])
17
17
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ::AmberComponent
4
- VERSION = '0.0.3'
4
+ VERSION = '0.0.5'
5
5
  end
@@ -55,7 +55,7 @@ module ::AmberComponent
55
55
  # @return [String, nil]
56
56
  def view_file_name
57
57
  files = asset_file_names(VIEW_FILE_REGEXP)
58
- raise MultipleViews, "More than one view file for `#{name}` found!" if files.length > 1
58
+ raise MultipleViewsError, "More than one view file for `#{name}` found!" if files.length > 1
59
59
 
60
60
  files.first
61
61
  end
@@ -81,7 +81,7 @@ module ::AmberComponent
81
81
  view_content = view_from_inline unless view_from_inline.empty?
82
82
 
83
83
  if view_content.nil? || view_content.empty?
84
- raise ViewFileNotFound, "View for `#{self.class}` could not be found!"
84
+ raise ViewFileNotFoundError, "View for `#{self.class}` could not be found!"
85
85
  end
86
86
 
87
87
  view_content
@@ -108,13 +108,13 @@ module ::AmberComponent
108
108
  content = content.to_s
109
109
 
110
110
  if content.empty?
111
- raise EmptyView, <<~ERR.squish
111
+ raise EmptyViewError, <<~ERR.squish
112
112
  Custom view for `#{self.class}` from view method cannot be empty!
113
113
  ERR
114
114
  end
115
115
 
116
116
  unless ALLOWED_VIEW_TYPES.include? type
117
- raise UnknownViewType, <<~ERR.squish
117
+ raise UnknownViewTypeError, <<~ERR.squish
118
118
  Unknown view type for `#{self.class}` from view method!
119
119
  Check return value of param type in `view :[type] do`
120
120
  ERR
@@ -5,16 +5,14 @@ require 'active_support/core_ext'
5
5
 
6
6
  module ::AmberComponent
7
7
  class Error < ::StandardError; end
8
- class ViewFileNotFound < Error; end
9
- class InvalidType < Error; end
8
+ class MissingPropsError < Error; end
9
+ class IncorrectPropTypeError < Error; end
10
+ class ViewFileNotFoundError < Error; end
11
+ class InvalidTypeError < Error; end
10
12
 
11
- class EmptyView < Error; end
12
- class UnknownViewType < Error; end
13
- class MultipleViews < Error; end
14
-
15
- class EmptyStyle < Error; end
16
- class UnknownStyleType < Error; end
17
- class MultipleStyles < Error; end
13
+ class EmptyViewError < Error; end
14
+ class UnknownViewTypeError < Error; end
15
+ class MultipleViewsError < Error; end
18
16
  end
19
17
 
20
18
  require_relative 'amber_component/version'
@@ -24,5 +22,6 @@ require_relative 'amber_component/template_handler'
24
22
  require_relative 'amber_component/views'
25
23
  require_relative 'amber_component/assets'
26
24
  require_relative 'amber_component/rendering'
25
+ require_relative 'amber_component/props'
27
26
  require_relative 'amber_component/base'
28
27
  require_relative 'amber_component/railtie' if defined?(::Rails::Railtie)
@@ -13,11 +13,30 @@ module ::AmberComponent
13
13
  # copy rake tasks
14
14
  def copy_tasks
15
15
  copy_file 'application_component.rb', 'app/components/application_component.rb'
16
+ copy_file 'application_component_test_case.rb', 'test/application_component_test_case.rb'
17
+ append_file 'test/test_helper.rb', "require_relative 'application_component_test_case'"
16
18
 
17
- inject_into_file 'app/assets/stylesheets/application.css', after: "*= require_tree .\n" do
19
+ require_components_css_in 'app/assets/stylesheets/application.css'
20
+ require_components_css_in 'app/assets/stylesheets/application.scss'
21
+ require_components_css_in 'app/assets/stylesheets/application.sass'
22
+ require_components_css_in 'app/assets/stylesheets/application.css.scss'
23
+ require_components_css_in 'app/assets/stylesheets/application.css.sass'
24
+ require_components_css_in 'app/assets/stylesheets/application.scss.sass'
25
+ require_components_css_in 'app/assets/stylesheets/application.sass.scss'
26
+ end
27
+
28
+ private
29
+
30
+ # @param file_name [String]
31
+ # @return [void]
32
+ def require_components_css_in(file_name)
33
+ return unless ::File.exist? file_name
34
+
35
+ inject_into_file file_name, after: "*= require_tree .\n" do
18
36
  " *= require_tree ./../../components\n"
19
37
  end
20
38
  end
39
+
21
40
  end
22
41
  end
23
42
  end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'amber_component/test_helper'
4
+
5
+ class ApplicationComponentTestCase < ::ActiveSupport::TestCase
6
+ include ::AmberComponent::TestHelper
7
+ end
@@ -7,12 +7,39 @@ class AmberComponentGenerator < ::Rails::Generators::NamedBase
7
7
  desc 'Generate a new component'
8
8
  source_root ::File.expand_path('templates', __dir__)
9
9
 
10
- # copy rake tasks
11
- def copy_tasks
10
+ # @return [Array<Symbol>]
11
+ VIEW_FORMATS = %i[html erb haml slim].freeze
12
+ # @return [Array<Symbol>]
13
+ STYLE_FORMATS = %i[css scss sass].freeze
14
+
15
+ class_option :view,
16
+ aliases: ['-v'],
17
+ desc: "Indicate what type of view should be generated eg. #{VIEW_FORMATS}"
18
+
19
+ class_option :css,
20
+ aliases: ['--style', '-c'],
21
+ desc: "Indicate what type of styles should be generated eg. #{STYLE_FORMATS}"
22
+
23
+ def generate_component
24
+ @view_format = (options[:view] || :html).to_sym
25
+ @view_format = :html if @view_format == :erb
26
+
27
+ @style_format = options[:css]&.to_sym
28
+
29
+ unless VIEW_FORMATS.include? @view_format
30
+ puts "No such view format as `#{@view_format}`"
31
+ return
32
+ end
33
+
34
+ if !@style_format.nil? && STYLE_FORMATS.include?(@style_format)
35
+ puts "No such css/style format as `#{@style_format}`"
36
+ return
37
+ end
38
+
12
39
  template 'component.rb.erb', "app/components/#{file_path}.rb"
13
40
  template 'component_test.rb.erb', "test/components/#{file_path}_test.rb"
14
- template 'view.html.erb', "app/components/#{file_path}/view.html.erb"
15
- template 'style.css.erb', "app/components/#{file_path}/style.css"
41
+ create_stylesheet
42
+ create_view
16
43
  end
17
44
 
18
45
  def file_name
@@ -21,4 +48,29 @@ class AmberComponentGenerator < ::Rails::Generators::NamedBase
21
48
 
22
49
  "#{name}_component"
23
50
  end
51
+
52
+ private
53
+
54
+ # @return [void]
55
+ def create_view
56
+ case @view_format
57
+ when :slim
58
+ template 'view.slim.erb', "app/components/#{file_path}/view.slim"
59
+ when :haml
60
+ template 'view.haml.erb', "app/components/#{file_path}/view.haml"
61
+ else
62
+ template 'view.html.erb.erb', "app/components/#{file_path}/view.html.erb"
63
+ end
64
+ end
65
+
66
+ # @return [void]
67
+ def create_stylesheet
68
+ if (@style_format.nil? && defined?(::SassC)) || @style_format == :scss
69
+ template 'style.scss.erb', "app/components/#{file_path}/style.scss"
70
+ elsif @style_format == :sass
71
+ template 'style.sass.erb', "app/components/#{file_path}/style.sass"
72
+ else
73
+ template 'style.css.erb', "app/components/#{file_path}/style.css"
74
+ end
75
+ end
24
76
  end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'fileutils'
4
+ require_relative 'amber_component_generator'
5
+
6
+ # A Rails generator which creates a new Amber component.
7
+ class ComponentGenerator < AmberComponentGenerator
8
+ source_root ::File.expand_path('templates', __dir__)
9
+ end
@@ -1,9 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class <%= class_name %> < ::ApplicationComponent
4
- # Your code goes here
4
+ # Props that your component accepts
5
+ prop :description, default: -> { 'Default Description' }
5
6
 
6
7
  after_initialize do
8
+ # some initialization
7
9
  @time = ::Time.now
8
10
  end
9
11
  end
@@ -2,8 +2,16 @@
2
2
 
3
3
  require 'test_helper'
4
4
 
5
- class <%= class_name %>Test < ::ActiveSupport::TestCase
6
- # test 'the truth' do
7
- # assert true
5
+ class <%= class_name %>Test < ::ApplicationComponentTestCase
6
+ # For a full list of available assertions see
7
+ # https://rubydoc.info/github/jnicklas/capybara/Capybara/Node/Matchers
8
+
9
+ # test 'returns correct html' do
10
+ # render do
11
+ # <%= class_name %>.call
12
+ # end
13
+
14
+ # assert_text 'Hello from <%= class_name %>'
15
+ # assert_selector "div.<%= singular_table_name %> p", text: 'Default Description'
8
16
  # end
9
17
  end
@@ -1,3 +1,3 @@
1
- .<%= singular_table_name %> {
1
+ .<%= singular_table_name %> h1 {
2
2
  color: blue;
3
3
  }
@@ -0,0 +1,3 @@
1
+ .<%= singular_table_name %>
2
+ h1
3
+ color: blue
@@ -0,0 +1,5 @@
1
+ .<%= singular_table_name %> {
2
+ h1 {
3
+ color: blue;
4
+ }
5
+ }
@@ -0,0 +1,9 @@
1
+ .<%= singular_table_name %>
2
+ %h1
3
+ Hello from
4
+ %b
5
+ <%= class_name %>
6
+ , initialized at:
7
+ = @time
8
+ %p
9
+ = description
@@ -0,0 +1,8 @@
1
+ <div class='<%= singular_table_name %>'>
2
+ <h1>
3
+ Hello from <b><%= class_name %></b>, initialized at: <%%= @time %>
4
+ </h1>
5
+ <p>
6
+ <%%= description %>
7
+ </p>
8
+ </div>
@@ -0,0 +1,6 @@
1
+ div.<%= singular_table_name %>
2
+ h1
3
+ | Hello from
4
+ b <%= class_name %>
5
+ | , initialized at: #{@time}
6
+ p = description
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amber_component
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruby-Amber
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2022-09-12 00:00:00.000000000 Z
13
+ date: 2022-11-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: actionview
@@ -107,34 +107,6 @@ files:
107
107
  - Rakefile
108
108
  - amber_component.gemspec
109
109
  - banner.png
110
- - docs/.bundle/config
111
- - docs/.gitignore
112
- - docs/404.html
113
- - docs/Gemfile
114
- - docs/Gemfile.lock
115
- - docs/README.md
116
- - docs/_config.yml
117
- - docs/_data/amber_component.yml
118
- - docs/_sass/_variables.scss
119
- - docs/_sass/color_schemes/amber_component.scss
120
- - docs/_sass/custom/custom.scss
121
- - docs/api/index.md
122
- - docs/assets/images/logo_wide.png
123
- - docs/changelog/index.md
124
- - docs/favicon.ico
125
- - docs/getting_started/index.md
126
- - docs/getting_started/installation.md
127
- - docs/getting_started/ruby_support.md
128
- - docs/getting_started/wireframes.md
129
- - docs/index.md
130
- - docs/introduction/basic_usage.md
131
- - docs/introduction/index.md
132
- - docs/introduction/why_amber_component.md
133
- - docs/resources/index.md
134
- - docs/styles/index.md
135
- - docs/styles/usage.md
136
- - docs/views/index.md
137
- - docs/views/usage.md
138
110
  - icon.png
139
111
  - lib/amber_component.rb
140
112
  - lib/amber_component/assets.rb
@@ -143,20 +115,30 @@ files:
143
115
  - lib/amber_component/helpers/class_helper.rb
144
116
  - lib/amber_component/helpers/component_helper.rb
145
117
  - lib/amber_component/helpers/css_helper.rb
118
+ - lib/amber_component/minitest_test_case.rb
119
+ - lib/amber_component/prop_definition.rb
120
+ - lib/amber_component/props.rb
146
121
  - lib/amber_component/railtie.rb
147
122
  - lib/amber_component/rendering.rb
148
123
  - lib/amber_component/template_handler.rb
149
124
  - lib/amber_component/template_handler/erb.rb
125
+ - lib/amber_component/test_helper.rb
150
126
  - lib/amber_component/typed_content.rb
151
127
  - lib/amber_component/version.rb
152
128
  - lib/amber_component/views.rb
153
129
  - lib/generators/amber_component/install_generator.rb
154
130
  - lib/generators/amber_component/templates/application_component.rb
131
+ - lib/generators/amber_component/templates/application_component_test_case.rb
155
132
  - lib/generators/amber_component_generator.rb
133
+ - lib/generators/component_generator.rb
156
134
  - lib/generators/templates/component.rb.erb
157
135
  - lib/generators/templates/component_test.rb.erb
158
136
  - lib/generators/templates/style.css.erb
159
- - lib/generators/templates/view.html.erb
137
+ - lib/generators/templates/style.sass.erb
138
+ - lib/generators/templates/style.scss.erb
139
+ - lib/generators/templates/view.haml.erb
140
+ - lib/generators/templates/view.html.erb.erb
141
+ - lib/generators/templates/view.slim.erb
160
142
  homepage: https://github.com/amber-ruby/amber_component
161
143
  licenses:
162
144
  - MIT
data/docs/.bundle/config DELETED
@@ -1,2 +0,0 @@
1
- ---
2
- BUNDLE_BUILD__EVENTMACHINE: "--with-cppflags=-I/opt/homebrew/opt/openssl@3/include"
data/docs/.gitignore DELETED
@@ -1,5 +0,0 @@
1
- _site/
2
- .sass-cache
3
- .jekyll-cache
4
- .jekyll-metadata
5
- vendor
data/docs/404.html DELETED
@@ -1,25 +0,0 @@
1
- ---
2
- permalink: /404.html
3
- layout: default
4
- ---
5
-
6
- <style type="text/css" media="screen">
7
- .container {
8
- margin: 10px auto;
9
- max-width: 600px;
10
- text-align: center;
11
- }
12
- h1 {
13
- margin: 30px 0;
14
- font-size: 4em;
15
- line-height: 1;
16
- letter-spacing: -1px;
17
- }
18
- </style>
19
-
20
- <div class="container">
21
- <h1>404</h1>
22
-
23
- <p><strong>Page not found :(</strong></p>
24
- <p>The requested page could not be found.</p>
25
- </div>
data/docs/Gemfile DELETED
@@ -1,37 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
- # Hello! This is where you manage which Jekyll version is used to run.
5
- # When you want to use a different version, change it below, save the
6
- # file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
7
- #
8
- # bundle exec jekyll serve
9
- #
10
- # This will help ensure the proper Jekyll version is running.
11
- # Happy Jekylling!
12
- gem 'jekyll', '~> 4.2.2'
13
- gem 'just-the-docs' # Theme for Jekyll docs.
14
- gem 'webrick'
15
- # This is the default theme for new Jekyll sites. You may change this to anything you like.
16
- gem 'minima', '~> 2.5'
17
- # If you want to use GitHub Pages, remove the "gem "jekyll"" above and
18
- # uncomment the line below. To upgrade, run `bundle update github-pages`.
19
- # gem "github-pages", group: :jekyll_plugins
20
- # If you have any plugins, put them here!
21
- group :jekyll_plugins do
22
- gem 'jekyll-feed', '~> 0.12'
23
- end
24
-
25
- # Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
26
- # and associated library.
27
- platforms :mingw, :x64_mingw, :mswin, :jruby do
28
- gem 'tzinfo', '~> 1.2'
29
- gem 'tzinfo-data'
30
- end
31
-
32
- # Performance-booster for watching directories on Windows
33
- gem 'wdm', '~> 0.1.1', platforms: %i[mingw x64_mingw mswin]
34
-
35
- # Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem
36
- # do not have a Java counterpart.
37
- gem 'http_parser.rb', '~> 0.6.0', platforms: [:jruby]