hanmoto 0.3.0 → 0.4.0

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
- SHA1:
3
- metadata.gz: e66e72321d84df130dffa4b8019a9dc51358e0a3
4
- data.tar.gz: 76137c4702a891fb894b76df1d6fe628f4d96930
2
+ SHA256:
3
+ metadata.gz: ad3cfa703078e53f844bf81ade2ed249b4b130e6ae13b06ea19bef8f94b91e3a
4
+ data.tar.gz: cc14fb1e3b0af7a340d584d17e828ad082085e0fe02750de30552af67852b7ba
5
5
  SHA512:
6
- metadata.gz: 4dc24fcc55d04a87ceb9dacaa1a937c5c1b02ea92645ac279889e5176be05773fa4cfab102018c4063a37b1a89da40809efb261e7a470ceeed83610369a4ffb9
7
- data.tar.gz: 9b06aecf392ca1cc64792063afcbe0ac938d36133cf3a9ce1ac38bb5f11473f4b03a37ec123853935f53e7fe43d3c77f0775e6262859f3e8b6fb9f64b0ee9c09
6
+ metadata.gz: 6bd456105ba4522d6db5551bc9f73397acafefc1570c510d191e3a4c168b58a4b6f51581b6d86bba1b44b2333b798b1ce9ac99a700cee127cb4315efb4122457
7
+ data.tar.gz: 79bd2d15fa80a03922676b183bd05c1afef616a109d98acce635610e5676f6c3aa57302d6b1db8823c598ef66febf179f18b3e5fdf3488d2264a4af712d53946
data/README.md CHANGED
@@ -79,6 +79,19 @@ Or install it yourself as:
79
79
  $ gem install hanmoto
80
80
  ```
81
81
 
82
+ ## Configuration
83
+
84
+ In `config/initializers/hanmoto.rb`, you can configure the following values.
85
+
86
+ ```ruby
87
+ Hanmoto.configure do |config|
88
+ # config.view_dir = 'public_page'
89
+ # config.layouts = {
90
+ # html: 'public',
91
+ # }
92
+ end
93
+ ```
94
+
82
95
  ## Contributing
83
96
 
84
97
  Contribution directions go here.
data/lib/hanmoto.rb CHANGED
@@ -1,3 +1,14 @@
1
1
  require 'hanmoto/railtie'
2
+ require 'hanmoto/configuration'
3
+
2
4
  module Hanmoto
5
+ class << self
6
+ def configure
7
+ yield(configuration)
8
+ end
9
+
10
+ def configuration
11
+ @configuration ||= Configuration.new
12
+ end
13
+ end
3
14
  end
@@ -0,0 +1,18 @@
1
+ module Hanmoto
2
+ class Configuration
3
+ OPTIONS = %i[view_dir layouts]
4
+
5
+ attr_accessor *OPTIONS
6
+
7
+ def initialize
8
+ @view_dir = 'public_pages'
9
+ @layouts = {
10
+ html: 'public',
11
+ }
12
+ end
13
+
14
+ def to_h
15
+ OPTIONS.map { |name| [name, public_send(name)] }.to_h
16
+ end
17
+ end
18
+ end
@@ -5,13 +5,6 @@ require 'hanmoto/rake_task_extension'
5
5
 
6
6
  module Hanmoto
7
7
  class Railtie < Rails::Railtie
8
- # options
9
- config.hanmoto = ActiveSupport::OrderedOptions.new
10
- config.hanmoto.view_dir = 'public_pages'
11
- config.hanmoto.layouts = {
12
- html: 'public',
13
- }
14
-
15
8
  rake_tasks do
16
9
  load File.expand_path('../../tasks/hanmoto_tasks.rake', __FILE__)
17
10
  end
@@ -1,3 +1,3 @@
1
1
  module Hanmoto
2
- VERSION = '0.3.0'
2
+ VERSION = '0.4.0'
3
3
  end
@@ -3,6 +3,6 @@ namespace :hanmoto do
3
3
  task publish: :environment do
4
4
  # NOTE: clear cache
5
5
  ActionView::Base.assets_manifest = Sprockets::Railtie.build_manifest(Rails.application)
6
- Hanmoto::Task.run(Rails.application.config.hanmoto)
6
+ Hanmoto::Task.run(Hanmoto.configuration.to_h)
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hanmoto
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - aki77
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-15 00:00:00.000000000 Z
11
+ date: 2019-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -77,6 +77,7 @@ files:
77
77
  - README.md
78
78
  - Rakefile
79
79
  - lib/hanmoto.rb
80
+ - lib/hanmoto/configuration.rb
80
81
  - lib/hanmoto/railtie.rb
81
82
  - lib/hanmoto/rake_task_extension.rb
82
83
  - lib/hanmoto/task.rb
@@ -101,8 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
102
  - !ruby/object:Gem::Version
102
103
  version: '0'
103
104
  requirements: []
104
- rubyforge_project:
105
- rubygems_version: 2.6.14
105
+ rubygems_version: 3.0.3
106
106
  signing_key:
107
107
  specification_version: 4
108
108
  summary: Public pages management with Asset Pipeline