alki-rails 0.1.0 → 0.3.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
2
  SHA1:
3
- metadata.gz: 0be7330439afdd21ac9167436a58a353f82d08ba
4
- data.tar.gz: 4950b9abd7e6c052e06a5325358e7c02f56a9fab
3
+ metadata.gz: 401649793ac23a7eef15815fdf8b5b92131a822d
4
+ data.tar.gz: bab6bc5a1e1b91408e51f116b67a8307dc1ddc33
5
5
  SHA512:
6
- metadata.gz: 25bc1d6905b30601be005013e8bab059d2915fc162b5dd4db0752c9575397dae3385bd7e4a6e6706fd7e138a1ae0312d83655bbe1b2dfae47992a26841214460
7
- data.tar.gz: 4bf81f9a0cd40750c8c69848a0ca39d5526502f8477932e67bb76581d82fbb471499bdbe14a4d76ff80dcd51fd2857fd57d3567cd6ea5942fc68afb69fec1b63
6
+ metadata.gz: ec73505b12483fe5c76ae0aa716d9727e18bd4790b83fea5ec6077fcdf654a52286e7997274201458c0b9b93b35cf3d14319d7c355c864584d452c9263974cc8
7
+ data.tar.gz: 9f3b7298ecf271f279002add6cba5806c8af1a16dc69c3b96f2f4de30c1bfdf9f7fa0e0e33a50804fe5806313e3df0d25639ab87e85047ab5747e88daa262323
@@ -1,22 +1,30 @@
1
- # Alki::Rails
1
+ = Alki::Rails
2
2
 
3
3
  Rails integration for Alki! Allows easily using Alki in your Rails project. Alki is a dependency injection and program organization framework.
4
4
 
5
- ## Installation
5
+ == Why use Alki with Rails?
6
+
7
+
8
+
9
+ == Installation
6
10
 
7
11
  Add this line to your Rails application's Gemfile:
8
12
 
9
- ```ruby
13
+ [source,ruby]
14
+ ----
10
15
  gem 'alki-rails'
11
- ```
16
+ ----
12
17
 
13
18
  And then execute:
14
19
 
15
- $ bundle
20
+ [source]
21
+ ----
22
+ $ bundle
23
+ ----
16
24
 
17
25
  Create a `config/alki` directory and then create an empty Alki Assembly definition in an `assembly.rb` file inside that.
18
26
 
19
- .config/alki/assembly.rb
27
+ .config/assembly.rb
20
28
  ```ruby
21
29
  Alki do
22
30
 
@@ -25,19 +33,20 @@ end
25
33
 
26
34
  Finally, add the following to your ApplicationController class:
27
35
 
28
- ```ruby
36
+ [source,ruby]
37
+ ----
29
38
  include Alki::Rails
30
- ```
39
+ ----
31
40
 
32
- ## Usage
41
+ == Usage
33
42
 
34
43
  Element defined in your Assembly definition will be callable directly from your assembly:
35
44
 
36
- .config/alki/assembly.rb
45
+ .config/assembly.rb
37
46
  ```ruby
38
47
  Alki do
39
48
  group :settings do
40
- set :msg, "Hello World"
49
+ set :msg, 'Hello World'
41
50
  end
42
51
  end
43
52
  ```
@@ -56,19 +65,17 @@ Elements can also be accessed in the Rails console, or anywhere else in your Rai
56
65
  .Rails Console
57
66
  ```
58
67
  2.3.2 :001 > Alki::Rails.settings.msg
59
- => "Hello World"
68
+ => 'Hello World'
60
69
  ```
61
70
 
62
71
  Alki will automatically add your projects `lib` directory to the ruby load path, so you can require files from there directly. It also will handle auto-reloading files in lib.
63
72
 
64
- See [here](https://github.com/alki-project/alki) for more documentation on how to use Alki.
65
-
66
- ## Contributing
67
-
68
- Bug reports and pull requests are welcome on GitHub at https://github.com/alki-project/alki-rails. 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.
73
+ See https://github.com/alki-project/alki[here] for more documentation on how to use Alki.
69
74
 
75
+ == Contributing
70
76
 
71
- ## License
77
+ Bug reports and pull requests are welcome on GitHub at https://github.com/alki-project/alki-rails[https://github.com/alki-project/alki-rails]. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the http://contributor-covenant.org[Contributor Covenant] code of conduct.
72
78
 
73
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
79
+ == License
74
80
 
81
+ The gem is available as open source under the terms of the http://opensource.org/licenses/MIT[MIT License].
data/alki-rails.gemspec CHANGED
@@ -22,6 +22,6 @@ Gem::Specification.new do |spec|
22
22
 
23
23
  spec.add_development_dependency "bundler", "~> 1.13"
24
24
  spec.add_development_dependency "rake", "~> 10.0"
25
- spec.add_dependency "alki", "~> 0.9", ">= 0.9.1"
26
- spec.add_dependency "alki-reload", "~> 0.1"
25
+ spec.add_dependency "alki", "~> 0.11"
26
+ spec.add_dependency "alki-reload", "~> 0.3"
27
27
  end
data/lib/alki/rails.rb CHANGED
@@ -4,10 +4,10 @@ module Alki
4
4
  module Rails
5
5
  module Instance
6
6
  def self.build_assembly
7
- unless File.exist? ::Rails.root.join('config','alki','assembly.rb').to_s
8
- raise "Alki::Rails requires a config/alki/assembly.rb file to exist!!"
7
+ unless File.exist? ::Rails.root.join('config','assembly.rb').to_s
8
+ raise "Alki::Rails requires a config/assembly.rb file to exist!!"
9
9
  end
10
- Alki.create_assembly config_dir: ::Rails.root.join('config','alki').to_s, name: 'alki_rails_assembly'
10
+ Alki.create_assembly(config_dir: ::Rails.root.join('config').to_s, name: 'alki_rails_assembly')
11
11
  end
12
12
 
13
13
  def self.alki_module
@@ -18,7 +18,11 @@ module Alki
18
18
  @instance ||= alki_module.new do
19
19
  mount :reloader, 'alki/reload' do
20
20
  set(:root_dir) { ::Rails.root }
21
- set(:watch) { !::Rails.application.config.cache_classes }
21
+ set(:enable) { !::Rails.application.config.cache_classes }
22
+ end
23
+ end.tap do |instance|
24
+ ActiveSupport::Reloader.after_class_unload do
25
+ instance.reloader.reload
22
26
  end
23
27
  end
24
28
  end
@@ -1,5 +1,5 @@
1
1
  module Alki
2
2
  module Rails
3
- VERSION = "0.1.0"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alki-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Edlefsen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-20 00:00:00.000000000 Z
11
+ date: 2017-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -44,34 +44,28 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0.9'
48
- - - ">="
49
- - !ruby/object:Gem::Version
50
- version: 0.9.1
47
+ version: '0.11'
51
48
  type: :runtime
52
49
  prerelease: false
53
50
  version_requirements: !ruby/object:Gem::Requirement
54
51
  requirements:
55
52
  - - "~>"
56
53
  - !ruby/object:Gem::Version
57
- version: '0.9'
58
- - - ">="
59
- - !ruby/object:Gem::Version
60
- version: 0.9.1
54
+ version: '0.11'
61
55
  - !ruby/object:Gem::Dependency
62
56
  name: alki-reload
63
57
  requirement: !ruby/object:Gem::Requirement
64
58
  requirements:
65
59
  - - "~>"
66
60
  - !ruby/object:Gem::Version
67
- version: '0.1'
61
+ version: '0.3'
68
62
  type: :runtime
69
63
  prerelease: false
70
64
  version_requirements: !ruby/object:Gem::Requirement
71
65
  requirements:
72
66
  - - "~>"
73
67
  - !ruby/object:Gem::Version
74
- version: '0.1'
68
+ version: '0.3'
75
69
  description:
76
70
  email:
77
71
  - matt.edlefsen@gmail.com
@@ -83,7 +77,7 @@ files:
83
77
  - CODE_OF_CONDUCT.md
84
78
  - Gemfile
85
79
  - LICENSE.txt
86
- - README.md
80
+ - README.adoc
87
81
  - Rakefile
88
82
  - alki-rails.gemspec
89
83
  - lib/alki-rails.rb