alki 0.13.3 → 0.14.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
- SHA1:
3
- metadata.gz: 477bb49ab83abf569bcc2b415b077cf15428c016
4
- data.tar.gz: 32261729b502b2a85e66f5fa6b00f4c6ecd20adf
2
+ SHA256:
3
+ metadata.gz: 0c6c996e3cc167d5050b102082788df3b5a903c04f7ac47c916a3e972d9b08b4
4
+ data.tar.gz: '0998b6b90e8662383ee9dbeb612eea8d46d9f8e7f71facb5dcb6eca9c445a66e'
5
5
  SHA512:
6
- metadata.gz: 250fe69e4e13e33b5e66886fba89685511fafe043c45ecbf69c419075f249f069f80a791bcee2e1d569d2a8ab533321a6625c868c65ab30d5db7809958367c57
7
- data.tar.gz: 229abd1df5d0b641eb2ace2d7ebf7788a0b750daed24db20d648cf52b5cee416313a9e2332fcce65fa567ec5885b676f4a1b9394b8d867fdb44cdb17c7f569bb
6
+ metadata.gz: ae2e60c2e81b564e29af9867fc4377200ee52a65cb5b14f4703b22e196a9e79fec6e45284e87aea3e876c457f66497aaf2bab4850d8900f3e2e69e12b6d185f5
7
+ data.tar.gz: 9d2d44039ded951d456e1a937f17c95499dca97e99dc968fdc5aedc5812e75ed022495efec372fba2ac6a165815e289563d0ec69693dec1fb2b9e1969b4c2ec8
data/.gitignore CHANGED
@@ -19,4 +19,5 @@ tmp
19
19
  *.o
20
20
  *.a
21
21
  mkmf.log
22
- *.iml
22
+ *.iml
23
+ /bin/
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.10
4
+ - 2.5.1
5
+ - jruby
@@ -1,21 +1,27 @@
1
- # What is Alki?
1
+ = What is Alki?
2
+
3
+ image:https://travis-ci.org/alki-project/alki.svg?branch=master["Build Status", link="https://travis-ci.org/alki-project/alki"]
2
4
 
3
5
  Alki (AL-kai) is a Dependency Injection framework for Ruby. Alki is designed to help organize and scale your project,
4
6
  so you can focus on the important stuff.
5
- It can be used alongside frameworks such as Ruby on Rails.
7
+ It can be used alongside frameworks such as http://alki.io/projects/alki-rails.html[Ruby on Rails].
6
8
 
7
9
  Some high level features:
8
10
 
9
11
  * Easily manage objects and dependencies
10
12
  * Enables writing reusable and testable code
11
13
  * Requires no annotations, mixins, or other changes to your code.
12
- * https://github.com/alki-project/alki-console[Developer console] (built on pry)
13
- * Automatic https://github.com/alki-project/alki-reload[code reloading]
14
- * Powerful https://github.com/alki-project/alki-dsl[DSL toolkit]
14
+ * http://alki.io/projects/alki-console.html[Developer console] (built on pry)
15
+ * Automatic http://alki.io/projects/alki-reload.html[code reloading]
16
+ * Powerful http://alki.io/projects/alki-dsl/[DSL toolkit]
15
17
  * Extensible
16
18
 
19
+ For more documentation, check out http://alki.io[alki.io].
20
+
21
+ For questions or discussion about Alki, head over to the https://groups.google.com/forum/#!forum/alki-project[Google Group].
17
22
 
18
- ## Installation
23
+ [[installation]]
24
+ == Installation
19
25
 
20
26
  Add this line to your application's Gemfile:
21
27
 
@@ -31,19 +37,298 @@ Or install it yourself as:
31
37
 
32
38
  $ gem install alki
33
39
 
34
- ## Introduction
35
-
36
- [NOTE]
37
- Full "todo" example can be found https://github.com/alki-project/alki-examples/tree/master/todo[here]
40
+ == How to use Alki
38
41
 
39
42
  Alki simplifies project organization by pulling out all of the "connective tissue"
40
- that connects our classes and modules together, and puts them into a special object
41
- called an Assembly.
43
+ that connects your classes and modules together.
44
+ Alki provides a central place to build your application objects,
45
+ where they can easily refer to other objects,
46
+ and access configuration settings.
47
+
48
+ For example,
49
+ if your project has an http client
50
+
51
+ .my_project/http_client.rb
52
+ ```ruby
53
+ module MyProject
54
+ class HttpClient
55
+ ...
56
+ end
57
+ end
58
+ ```
59
+
60
+ you might normally use it by either creating a new instance of it when needed,
61
+ or directly calling methods on the class.
62
+
63
+ ```ruby
64
+ client = MyProject::HttpClient.new
65
+ client.get '/page1.html'
66
+ # -or-
67
+ MyProject::HttpClient.get '/page1.html'
68
+ ```
69
+
70
+ With Alki, you would instead define instructions for how to build the http client.
71
+
72
+ .config/assembly.rb
73
+ ```ruby
74
+ Alki do
75
+ service :http_client do
76
+ require 'my_project/http_client'
77
+ MyProject::HttpClient.new
78
+ end
79
+ end
80
+ ```
42
81
 
43
- There are many ways to use Assemblies, but the most common is to have a single
44
- Assembly for a project. For example, if you hade a "todo" command line utility
45
- project that you wanted to use Alki with, all you would need to do to create
46
- an Assembly is add this file.
82
+ The 'service' method defines a new object with the name 'http_client',
83
+ and the provided block contains the code needed to build it.
84
+
85
+ To use the http client, an "Assembly" for the project has to be created.
86
+ Assemblies are container objects that hold your application objects once
87
+ they're built.
88
+
89
+ Typically you can just add the following code to your project's main library file.
90
+ More information can be found about this method http://alki.io/assemblies/project_assemblies.html[here].
91
+
92
+ .lib/my_project.rb
93
+ ```ruby
94
+ require 'alki'
95
+ Alki.project_assembly!
96
+ ```
97
+
98
+ This will add a 'new' method to the the MyProject module,
99
+ which will return a new Assembly instance.
100
+ The http client can be accessed by calling the method that matches the name we chose for it
101
+ when it was defined,
102
+ 'http_client'.
103
+
104
+ ```ruby
105
+ require 'my_project'
106
+
107
+ app = MyProject.new
108
+ app.http_client.get '/page1.html'
109
+ ```
110
+
111
+ === Configuration Settings
112
+
113
+ Most projects, at some point,
114
+ have to deal with configuration settings.
115
+
116
+ In Ruby the typical pattern is to reference Modules and Classes directly,
117
+ either by constructing them on demand when needed,
118
+ or calling class methods on them.
119
+
120
+ Often this leaves Modules and Classes to essentially have to configure themselves.
121
+ Sometimes this is by pulling configuration from the environment or a configration file,
122
+ sometimes it's by requiring a global variable to be set before the class is used.
123
+
124
+ This means that classes are often cluttered with configuration code.
125
+ Classes from different libraries might have different, inconsistent ways of being configured,
126
+ and it can be difficult if not impossible to change how they're configured.
127
+
128
+ In Alki, configuration becomes straightforward.
129
+ Classes can just take configuration settings as initializer parameters,
130
+ without worrying about where they comes from.
131
+
132
+ .lib/my_project/http_client.rb
133
+ ```
134
+ module MyProject
135
+ class HttpClient
136
+ def initializer(base_uri)
137
+ @base_uri = base_uri
138
+ end
139
+ ...
140
+ end
141
+ end
142
+ ```
143
+
144
+ Then the Assembly can be updated to pass in a configuration parameter.
145
+ We can also define a new element for our base_url setting.
146
+
147
+ .config/assembly.rb
148
+ ```ruby
149
+ Alki do
150
+ set :http_base_url do
151
+ ENV.fetch('HTTP_BASE_URL')
152
+ end
153
+
154
+ service :http_client do
155
+ require 'my_project/http_client'
156
+ MyProject::HttpClient.new http_base_url
157
+ end
158
+ end
159
+ ```
160
+
161
+ The 'set' method is used to define simple values in the Assembly,
162
+ and the http client can refer to it by name.
163
+
164
+ Nothing changes with how we use the http client,
165
+ but it's now pulling it's configuration from the environment.
166
+
167
+ Changing this to have a default value,
168
+ pull from a different source,
169
+ or have multiple clients with different configuration parameters
170
+ can be done easily without changing the class code.
171
+
172
+ For example,
173
+ to change the settings to come from a YAML file we can define a new
174
+ element to parse the YAML file,
175
+ and then redifine our setting to pull it's value from the parsed options.
176
+ Note that the order doesn't matter.
177
+ Even if a dependency is defined after an element that uses it,
178
+ the objects will still be built in the correct order.
179
+
180
+ .config/assembly.rb
181
+ ```ruby
182
+ Alki do
183
+ set :yaml_settings do
184
+ require 'yaml'
185
+ YAML.load_file File.join(config_dir,'settings.yml')
186
+ end
187
+
188
+ set :http_base_url do
189
+ yaml_settings['http_base_ur']
190
+ end
191
+
192
+ service :http_client do
193
+ require 'my_project/http_client'
194
+ MyProject::HttpClient.new http_base_url
195
+ end
196
+ end
197
+ ```
198
+
199
+ No changes to the class,
200
+ or in this case even the build code for the http client,
201
+ are required.
202
+
203
+ Configuration settings can be grouped together in the assembly,
204
+ to namespace them.
205
+ This group can be called anything, but we'll call it 'settings'.
206
+
207
+ .config/assembly.rb
208
+ ```ruby
209
+ Alki do
210
+ group :settings do
211
+ set :http_base_url do
212
+ yaml_settings['http_base_ur']
213
+ end
214
+
215
+ set :yaml_settings do
216
+ require 'yaml'
217
+ YAML.parse(File.read(File.join(config_dir,'settings.yml')))
218
+ end
219
+ end
220
+
221
+ service :http_client do
222
+ require 'my_project/http_client'
223
+ MyProject::HttpClient.new settings.http_base_url
224
+ end
225
+ end
226
+ ```
227
+
228
+ The can also be moved to an entirely different file to keep them
229
+ seperate from your application objects.
230
+
231
+ .config/settings.rb
232
+ ```ruby
233
+ Alki do
234
+ set :http_base_url do
235
+ yaml_settings['http_base_ur']
236
+ end
237
+
238
+ set :yaml_settings do
239
+ require 'yaml'
240
+ YAML.parse(File.read(File.join(config_dir,'settings.yml')))
241
+ end
242
+ end
243
+ ```
244
+
245
+ .config/assembly.rb
246
+ ```ruby
247
+ Alki do
248
+ load :settings
249
+
250
+ service :http_client do
251
+ require 'my_project/http_client'
252
+ MyProject::HttpClient.new settings.http_base_url
253
+ end
254
+ end
255
+ ```
256
+
257
+ == Dependency Injection
258
+
259
+ Dependency Injection is a way of designing your classes to maximise
260
+ their modularity and reusability.
261
+
262
+ Much like with configuration settings,
263
+ instead of directly referencing a classes dependencies a depenency injected
264
+ class takes it's dependencies as arguments.
265
+
266
+ The advantage of this is that classes can be developed and tested in isolation,
267
+ can have dependencies easily changed by other code (like users of a library),
268
+ or have multiple instances with different dependencies.
269
+
270
+ Like configuration settings,
271
+ a lot of Ruby projects end up needing some amount of dependency injection,
272
+ but it's typically implemented in an ad-hoc way with class variables or other global
273
+ variables.
274
+
275
+ With Alki, dependency injection is the norm and very straightforward.
276
+
277
+ Perhaps we have client for API that works over HTTP.
278
+ We can write our API client so that it takes an HTTP client as an arugment
279
+ and just calls methods on it.
280
+ It doesn't need to pick a particular client library or decide what configuration
281
+ settings it should have.
282
+
283
+ .lib/my_project/api_client.rb
284
+ ```ruby
285
+ module MyProject
286
+ class ApiClient
287
+ def initialize(http_client)
288
+ @http_client = http_client
289
+ end
290
+
291
+ def all
292
+ parse_response @http_client.get('/all.json')
293
+ end
294
+
295
+ ...
296
+ end
297
+ end
298
+ ```
299
+
300
+ With this design it's easy to change out the http client,
301
+ or provide a stubbed or mocked one for testing.
302
+ It maximizes the reusability of our API client
303
+ because it only handles one thing
304
+ (Single Responsibility Principle).
305
+
306
+ To add it to the previous assembly definition.
307
+
308
+ .config/assembly.rb
309
+ ```ruby
310
+ load :settings
311
+
312
+ service :api_client do
313
+ require 'my_project/api_client'
314
+ MyProject::ApiClient.new http_client
315
+ end
316
+
317
+ service :http_client do
318
+ require 'my_project/http_client'
319
+ MyProject::HttpClient.new settings.http_base_url
320
+ end
321
+ ```
322
+
323
+ == Example
324
+
325
+ [NOTE]
326
+ Full "todo" source code can be found https://github.com/alki-project/alki-examples/tree/master/todo[here]
327
+
328
+ To demonstrate how a full Alki project can be put together,
329
+ we'll go through an example application.
330
+ This application is a little todo list command line utility
331
+ that stores the todo list in a json file.
47
332
 
48
333
  .lib/todo.rb
49
334
  ```ruby
@@ -61,25 +346,25 @@ $ bundle exec irb -Ilib
61
346
  => #<Todo:21964520>
62
347
  ```
63
348
 
64
- ### Defining Elements
65
-
66
- Adding things to the assembly requires an assembly definition file. By convention this is
67
- named `config/assembly.rb` and is built using a simple DSL. There are
68
- a handful of different element types in Assemblies. Below are a few of the
69
- most common. Full documentation of the DSL can be found at http://alki.io[alki.io].
349
+ [[defining-elements]]
350
+ === Defining Elements
70
351
 
352
+ Adding things to the assembly requires an Assembly definition file.
353
+ By convention this is named `config/assembly.rb` and is built using a DSL.
354
+ There are a handful of different element types in Assemblies.
71
355
  Elements can refer to other elements, and can be defined in any order.
72
356
 
357
+ Full documentation of the DSL can be found http://alki.io/dsl/[here].
358
+
359
+ Below is an example Assembly definition for the todo application
360
+ which uses a few of the core element types.
361
+
73
362
  .config/assembly.rb
74
363
  ```ruby
75
364
  Alki do
76
- group :settings do <1>
77
- set(:home) { ENV['HOME'] } <2>
78
- set(:db_path) { ENV['TODO_DB_PATH'] || File.join(home,'.todo_db') }
79
- set :prompt, 'todo> '
80
- end
365
+ load :settings
81
366
 
82
- service :interface do <3>
367
+ service :interface do
83
368
  require 'todo/readline_interface'
84
369
  Todo::ReadlineInterface.new settings.prompt, handler
85
370
  end
@@ -100,11 +385,21 @@ Alki do
100
385
  end
101
386
  end
102
387
  ```
103
- <1> `group` allows bundling together subelements (and which can be moved to their own files)
104
- <2> `set` defines simple values
105
- <3> `service` defines our main application objects
106
388
 
107
- Any element can be accessed directly from the assembly object.
389
+ Along with a settings file to define our application settings.
390
+
391
+ .config/settings.rb
392
+ ```ruby
393
+ Alki do
394
+ set(:home) { ENV['HOME'] }
395
+ set(:db_path) { ENV['TODO_DB_PATH'] || File.join(home,'.todo_db') }
396
+ set :prompt, 'todo> '
397
+ end
398
+ ```
399
+
400
+ Settings and services can be accessed by requiring the main "lib/todo.rb" file,
401
+ creating a new assembly instance,
402
+ and then calling methods to refer to the different elements.
108
403
 
109
404
  ```
110
405
  $ bundle exec irb -Ilib
@@ -112,7 +407,9 @@ $ bundle exec irb -Ilib
112
407
  => true
113
408
  2.4.0 :002 > todo = Todo.new
114
409
  => #<Todo:21964520>
115
- 2.4.0 :003 > todo.interface.run
410
+ 2.4.0 :003 > todo.settings.prompt
411
+ => "> "
412
+ 2.4.0 :004 > todo.interface.run
116
413
  > ?
117
414
  All commands can be shortened to their first letters
118
415
  print
@@ -126,8 +423,11 @@ quit
126
423
 
127
424
  ```
128
425
 
129
- The 'alki-console' tool can also be used to quickly work with assemblies.
130
- Add `gem 'alki-console'` to your Gemfile and run `bundle --binstubs`.
426
+ The http://alki.io/projects/alki-console.html[alki-console] developer console gem can also be used to quickly work with assemblies.
427
+ It can be used by adding `gem 'alki-console'` to the Gemfile and running `bundle --binstubs` to add the console script to the 'bin' directory.
428
+
429
+ Elements can be accessed directly without having to manually create an
430
+ assembly instance.
131
431
 
132
432
  ```
133
433
  $ bin/alki-console
@@ -135,63 +435,45 @@ todo> settings.prompt
135
435
  => 'todo> '
136
436
  ```
137
437
 
438
+ [[executable]]
138
439
  ### Creating an executable
139
440
 
140
- Read more about creating executables with Alki
141
- http://alki.io/executables.html[here].
441
+ Read more about creating executables with Alki,
442
+ including how to create executables to distribute in a gem,
443
+ http://alki.io/assemblies/executables.html[here]
142
444
 
143
445
  In the todo example, it's a CLI utility so it requires an executable.
144
446
  The executable just needs to require the main project file,
145
447
  create a new instance of the assembly,
146
448
  and call a method on a service.
147
449
 
148
- .exe/todo
450
+ .bin/todo
149
451
  ```ruby
452
+ #!/usr/bin/env ruby
453
+
454
+ # Setup
455
+ require 'bundler/setup'
456
+ require 'alki/bin'
457
+
150
458
  require 'todo'
151
459
  Todo.new.interface.run
152
460
  ```
153
461
 
154
- ### Splitting up the Assembly configuration
155
-
156
- As a project grows, it's helpful to be able to split out
157
- parts of the Assembly configuration into multiple files.
158
-
159
- This can be accomplished with the `load` method in the DSL,
160
- which will load the named file and add it the elements
161
- defined in it as a group in the assembly.
162
-
163
- For example, it's common to split out application settings into
164
- a separate config file.
165
-
166
- .config/settings.rb
167
- ```ruby
168
- Alki do
169
- set(:home) { ENV['HOME'] }
170
- set(:db_path) { ENV['TODO_DB_PATH'] || File.join(home,'.todo_db') }
171
- set :prompt, 'todo> '
172
- end
173
462
  ```
174
-
175
- .config/assembly.rb
176
- ```ruby
177
- Alki do
178
- load :settings
179
-
180
- service :interface do
181
- require 'todo/readline_interface'
182
- Todo::ReadlineInterface.new settings.prompt, handler
183
- end
184
-
185
- ...
186
- end
463
+ $ bin/todo
464
+ > print
465
+ 1. take out the trash
466
+ > quit
467
+ $
187
468
  ```
188
469
 
189
- ## Further Documentation
190
-
191
- Further documentation can be found at http://alki.io[alki.io].
470
+ == Documentation
192
471
 
193
- Example projects can be found https://github.com/alki-project/alki-examples[here]
472
+ More documentation can be found at http://alki.io[alki.io],
473
+ with in-depth explanations of http://alki.io/assemblies/[Assemblies],
474
+ http://alki.io/dsl/[the Assembly DSL], and other
475
+ http://alki.io/projects/[projects] that are part of Alki.
194
476
 
195
- ## Authors
477
+ == Authors
196
478
 
197
479
  Written by Matt Edlefsen
@@ -8,18 +8,19 @@ Gem::Specification.new do |spec|
8
8
  spec.version = Alki::VERSION
9
9
  spec.authors = ["Matt Edlefsen"]
10
10
  spec.email = ["matt.edlefsen@gmail.com"]
11
- spec.summary = %q{Base library for building applications.}
12
- spec.description = %q{Base library for building applications. Provides tools for organizing and connecting application units.}
13
- spec.homepage = "https://github.com/alki-project/alki"
11
+ spec.summary = %q{Dependency Injection for Ruby}
12
+ spec.description = %q{Alki (AL-kai) is a Dependency Injection framework for Ruby. Helps organize and scale your project, so you can focus on the important stuff.}
13
+ spec.homepage = "http://alki.io"
14
14
  spec.license = "MIT"
15
15
  spec.files = `git ls-files -z`.split("\x0")
16
16
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
17
17
  spec.bindir = 'exe'
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
+ spec.required_ruby_version = '>= 2.1.0'
20
21
 
21
- spec.add_dependency "alki-dsl", "~> 0.5", '>= 0.5.1'
22
- spec.add_dependency "alki-support", "~> 0.7"
22
+ spec.add_dependency "alki-dsl", "~> 0.6"
23
+ spec.add_dependency "alki-support", "~> 0.7", ">= 0.7.1"
23
24
  spec.add_dependency "concurrent-ruby", "~> 1.0"
24
25
  spec.add_dependency "ice_nine", "~> 0.11"
25
26
  end
@@ -3,16 +3,20 @@ require 'alki/assembly/builder'
3
3
 
4
4
  Alki::Assembly::Builder.build project_assembly: __FILE__, load_mode: :require
5
5
 
6
- def Alki.project_assembly!(opts={},&blk)
7
- opts[:project_assembly] ||= caller_locations(1,1)[0].absolute_path
8
- opts[:load_mode] = :require
9
- Alki::Assembly::Builder.build(opts,&blk)
10
- end
6
+ class << Alki
7
+ def project_assembly!(opts={},&blk)
8
+ opts[:project_assembly] ||= caller_locations(1,1)[0].absolute_path
9
+ opts[:load_mode] = :require
10
+ Alki::Assembly::Builder.build(opts,&blk)
11
+ end
11
12
 
12
- def Alki.create_assembly(opts={},&blk)
13
- Alki::Assembly::Builder.build(opts,&blk)
14
- end
13
+ def create_assembly(opts={},&blk)
14
+ Alki::Assembly::Builder.build(opts,&blk)
15
+ end
16
+
17
+ def new(opts={},&blk)
18
+ Alki.create_assembly(opts,&blk).new
19
+ end
15
20
 
16
- def Alki.singleton_assembly(opts={},&blk)
17
- Alki.create_assembly(opts,&blk).new
21
+ alias_method :singleton_assembly, :new
18
22
  end
@@ -4,10 +4,10 @@ Alki do
4
4
  attr :block
5
5
 
6
6
  output do
7
- all_overlays = data[:overlays]&.overlays || []
7
+ all_overlays = (data[:overlays] && data[:overlays].overlays) || []
8
8
  value_overlays = all_overlays[:value] || []
9
9
  reference_overlays = all_overlays[:reference] || []
10
- tags = data[:tags]&.tags || {}
10
+ tags = (data[:tags] && data[:tags].tags) || {}
11
11
  methods = {
12
12
  __build__: block,
13
13
  __apply_overlays__: -> obj, overlays {
@@ -13,7 +13,7 @@ module Alki
13
13
  end
14
14
 
15
15
  def elements_in(tag)
16
- @tag_map[tag]&.keys || []
16
+ (@tag_map[tag] && @tag_map[tag].keys) || []
17
17
  end
18
18
 
19
19
  def index(key)
@@ -1,3 +1,3 @@
1
1
  module Alki
2
- VERSION = "0.13.3"
2
+ VERSION = "0.14.0"
3
3
  end
@@ -13,7 +13,7 @@ describe 'Auto Group' do
13
13
  end
14
14
 
15
15
  it 'should create a group containing all items' do
16
- @obj.grp.children.must_equal [:a,:one]
16
+ @obj.grp.children.sort.must_equal [:a,:one]
17
17
  @obj.grp.one.value.must_equal 1
18
18
  @obj.grp.a.children.must_equal [:two]
19
19
  @obj.grp.a.two.value.must_equal 2
@@ -6,7 +6,7 @@ describe 'Mounts' do
6
6
  set :val, :test
7
7
  end
8
8
 
9
- assembly = Alki.singleton_assembly do
9
+ assembly = Alki.new do
10
10
  mount :mounted, AlkiTest
11
11
  end
12
12
 
@@ -53,7 +53,7 @@ describe 'Overrides' do
53
53
 
54
54
  it 'should allow calling original when mounted' do
55
55
  other = @assembly
56
- instance = Alki.singleton_assembly do
56
+ instance = Alki.new do
57
57
  mount :assembly, other do
58
58
  set :val do
59
59
  original.val
@@ -3,7 +3,7 @@ require 'alki/feature_test'
3
3
  describe 'References' do
4
4
  describe 'circular references' do
5
5
  before do
6
- @assembly = Alki.singleton_assembly do
6
+ @assembly = Alki.new do
7
7
  set :a do
8
8
  b
9
9
  end
@@ -35,7 +35,7 @@ describe 'References' do
35
35
 
36
36
  describe 'reference objects' do
37
37
  before do
38
- @obj = Alki.singleton_assembly do
38
+ @obj = Alki.new do
39
39
  service :broken do
40
40
  1.foo
41
41
  end
@@ -2,7 +2,7 @@ require 'alki/feature_test'
2
2
 
3
3
  describe 'Try mounts' do
4
4
  it 'should not mount if other assembly can be found' do
5
- obj = Alki.singleton_assembly do
5
+ obj = Alki.new do
6
6
  try_mount :other, 'missing_assembly'
7
7
  set :val do
8
8
  respond_to? :other
@@ -12,7 +12,7 @@ describe 'Try mounts' do
12
12
  end
13
13
 
14
14
  it 'should mount if other assembly can be found' do
15
- obj = Alki.singleton_assembly do
15
+ obj = Alki.new do
16
16
  try_mount :other, 'example' # example fixture assembly
17
17
  set :val do
18
18
  respond_to? :other
@@ -7,7 +7,7 @@ describe 'Values' do
7
7
  true
8
8
  end
9
9
  end.new
10
- Alki.singleton_assembly do
10
+ Alki.new do
11
11
  set :obj, obj
12
12
  end
13
13
  end
metadata CHANGED
@@ -1,79 +1,79 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alki
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.3
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Edlefsen
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-23 00:00:00.000000000 Z
11
+ date: 2018-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: alki-dsl
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
16
  - - "~>"
18
17
  - !ruby/object:Gem::Version
19
- version: '0.5'
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 0.5.1
23
- type: :runtime
18
+ version: '0.6'
19
+ name: alki-dsl
24
20
  prerelease: false
21
+ type: :runtime
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: '0.5'
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 0.5.1
26
+ version: '0.6'
33
27
  - !ruby/object:Gem::Dependency
34
- name: alki-support
35
28
  requirement: !ruby/object:Gem::Requirement
36
29
  requirements:
37
30
  - - "~>"
38
31
  - !ruby/object:Gem::Version
39
32
  version: '0.7'
40
- type: :runtime
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: 0.7.1
36
+ name: alki-support
41
37
  prerelease: false
38
+ type: :runtime
42
39
  version_requirements: !ruby/object:Gem::Requirement
43
40
  requirements:
44
41
  - - "~>"
45
42
  - !ruby/object:Gem::Version
46
43
  version: '0.7'
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 0.7.1
47
47
  - !ruby/object:Gem::Dependency
48
- name: concurrent-ruby
49
48
  requirement: !ruby/object:Gem::Requirement
50
49
  requirements:
51
50
  - - "~>"
52
51
  - !ruby/object:Gem::Version
53
52
  version: '1.0'
54
- type: :runtime
53
+ name: concurrent-ruby
55
54
  prerelease: false
55
+ type: :runtime
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
60
  version: '1.0'
61
61
  - !ruby/object:Gem::Dependency
62
- name: ice_nine
63
62
  requirement: !ruby/object:Gem::Requirement
64
63
  requirements:
65
64
  - - "~>"
66
65
  - !ruby/object:Gem::Version
67
66
  version: '0.11'
68
- type: :runtime
67
+ name: ice_nine
69
68
  prerelease: false
69
+ type: :runtime
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0.11'
75
- description: Base library for building applications. Provides tools for organizing
76
- and connecting application units.
75
+ description: Alki (AL-kai) is a Dependency Injection framework for Ruby. Helps organize
76
+ and scale your project, so you can focus on the important stuff.
77
77
  email:
78
78
  - matt.edlefsen@gmail.com
79
79
  executables: []
@@ -81,14 +81,12 @@ extensions: []
81
81
  extra_rdoc_files: []
82
82
  files:
83
83
  - ".gitignore"
84
+ - ".travis.yml"
84
85
  - Gemfile
85
86
  - LICENSE.txt
86
87
  - README.adoc
87
88
  - Rakefile
88
89
  - alki.gemspec
89
- - bin/alki
90
- - bin/bundler
91
- - bin/rake
92
90
  - config/assembly.rb
93
91
  - lib/alki.rb
94
92
  - lib/alki/assembly.rb
@@ -171,11 +169,11 @@ files:
171
169
  - test/integration/dsls/assembly_test.rb
172
170
  - test/integration/dsls/assembly_type_test.rb
173
171
  - test/integration/dsls/service_dsl_test.rb
174
- homepage: https://github.com/alki-project/alki
172
+ homepage: http://alki.io
175
173
  licenses:
176
174
  - MIT
177
175
  metadata: {}
178
- post_install_message:
176
+ post_install_message:
179
177
  rdoc_options: []
180
178
  require_paths:
181
179
  - lib
@@ -183,18 +181,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
183
181
  requirements:
184
182
  - - ">="
185
183
  - !ruby/object:Gem::Version
186
- version: '0'
184
+ version: 2.1.0
187
185
  required_rubygems_version: !ruby/object:Gem::Requirement
188
186
  requirements:
189
187
  - - ">="
190
188
  - !ruby/object:Gem::Version
191
189
  version: '0'
192
190
  requirements: []
193
- rubyforge_project:
194
- rubygems_version: 2.6.12
195
- signing_key:
191
+ rubyforge_project:
192
+ rubygems_version: 2.6.13
193
+ signing_key:
196
194
  specification_version: 4
197
- summary: Base library for building applications.
195
+ summary: Dependency Injection for Ruby
198
196
  test_files:
199
197
  - test/feature/alki_test.rb
200
198
  - test/feature/auto_group_test.rb
data/bin/alki DELETED
@@ -1,17 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
- #
4
- # This file was generated by Bundler.
5
- #
6
- # The application 'alki' is installed as part of a gem, and
7
- # this file is here to facilitate running it.
8
- #
9
-
10
- require "pathname"
11
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
12
- Pathname.new(__FILE__).realpath)
13
-
14
- require "rubygems"
15
- require "bundler/setup"
16
-
17
- load Gem.bin_path("alki", "alki")
@@ -1,17 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
- #
4
- # This file was generated by Bundler.
5
- #
6
- # The application 'bundler' is installed as part of a gem, and
7
- # this file is here to facilitate running it.
8
- #
9
-
10
- require "pathname"
11
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
12
- Pathname.new(__FILE__).realpath)
13
-
14
- require "rubygems"
15
- require "bundler/setup"
16
-
17
- load Gem.bin_path("bundler", "bundler")
data/bin/rake DELETED
@@ -1,17 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
- #
4
- # This file was generated by Bundler.
5
- #
6
- # The application 'rake' is installed as part of a gem, and
7
- # this file is here to facilitate running it.
8
- #
9
-
10
- require "pathname"
11
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
12
- Pathname.new(__FILE__).realpath)
13
-
14
- require "rubygems"
15
- require "bundler/setup"
16
-
17
- load Gem.bin_path("rake", "rake")