motion-dependencies 0.0.1 → 0.0.2

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.
data/README.md CHANGED
@@ -1,5 +1,25 @@
1
- # Motion::Dependencies
1
+ # Ruby Motion Dependencies
2
+ ## Stop updating that ruby motion dependency hash.
3
+
4
+ Instead have dependencies built from
5
+ your files
2
6
 
7
+ ## Say goodbye to
8
+
9
+ ```ruby
10
+ app.files_dependencies {
11
+ 'app/foo_controller.rb' => 'app/app_controller.rb',
12
+ 'app/baz_controller.rb' => 'app/app_controller.rb'
13
+ }
14
+ ```
15
+ ## Say hello to
16
+
17
+ ```ruby
18
+ # depends app_controller.rb
19
+ class FooController < AppController
20
+
21
+ end
22
+ ```
3
23
 
4
24
 
5
25
  ## Installation
@@ -8,19 +28,23 @@
8
28
 
9
29
  Add this line to your application's Rakefile:
10
30
 
11
- require 'motion-dependencies'
12
- Motion::Project::App.setup do |app|
13
- app.files = Dir.glob('./app/lib/**/*.rb') | Dir.glob('./app/**/*.rb')
14
- app.files_dependencies = Motion::Dependencies.find_dependendcies(app.files)
15
- end
31
+ ```ruby
32
+ require 'motion-dependencies'
33
+ Motion::Project::App.setup do |app|
34
+ app.files = Dir.glob('./app/lib/**/*.rb') | Dir.glob('./app/**/*.rb')
35
+ app.files_dependencies Motion::Dependencies.find_dependencies(app.files)
36
+ end
37
+ ```
16
38
 
17
39
 
18
40
  ## Usage
19
41
 
20
- # depends your-mixin.rb
21
- class FooViewController < UIViewController
22
- include YourMixin
23
- end
42
+ ```ruby
43
+ # depends your-mixin.rb
44
+ class FooViewController < UIViewController
45
+ include YourMixin
46
+ end
47
+ ```
24
48
 
25
49
  ## Contributing
26
50
 
@@ -16,11 +16,12 @@ module Motion
16
16
  end
17
17
 
18
18
  def self.resolve_dependencies files, dependencies
19
- files.select do |file|
19
+ files = files.select do |file|
20
20
  dependencies.select do |dependency|
21
21
  file.include? dependency
22
22
  end.length > 0
23
23
  end
24
+ files.uniq
24
25
  end
25
26
 
26
27
  def self.find_dependencies(files)
@@ -1,5 +1,5 @@
1
1
  module Motion
2
2
  module Dependencies
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motion-dependencies
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-05 00:00:00.000000000 Z
12
+ date: 2012-06-12 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Rudimentary dependency support for Ruby Motion
15
15
  email: