neo-dci 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -16,6 +16,10 @@ Or install it yourself as:
16
16
 
17
17
  $ gem install neo-dci
18
18
 
19
+ You can generate base classes for your roles and contexts with
20
+
21
+ $ rake neo-dci:setup
22
+
19
23
  ## Usage
20
24
 
21
25
  ### Data
@@ -4,3 +4,5 @@ require 'neo/dci/data'
4
4
  require 'neo/dci/role'
5
5
  require 'neo/dci/context_result'
6
6
  require 'neo/dci/context'
7
+
8
+ require 'neo/dci/task_loader' if defined?(::Rails::Railtie)
@@ -0,0 +1,10 @@
1
+ module Neo
2
+ module DCI
3
+ # Load rake tasks under lib/tasks
4
+ class TaskLoader < ::Rails::Railtie
5
+ rake_tasks do
6
+ Dir[File.join(File.dirname(__FILE__),'../../tasks/**/*.rake')].each { |f| load f }
7
+ end
8
+ end
9
+ end
10
+ end
@@ -1,5 +1,5 @@
1
1
  module Neo
2
2
  module DCI
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
@@ -0,0 +1,25 @@
1
+ namespace :"neo-dci" do
2
+ desc "standard tasks for a new application"
3
+ task :setup => [:"build:context", :"build:role"] do
4
+ # nothing for its own
5
+ end
6
+
7
+ namespace :build do
8
+ def copy_from_share(path)
9
+ templates = File.expand_path("../share/", __FILE__)
10
+ rails = Rails.root.to_s
11
+ sh "mkdir -p #{rails}/#{File.dirname path}"
12
+ cp "#{templates}/#{path}", "#{rails}/#{path}"
13
+ end
14
+
15
+ desc "build application base role"
16
+ task :role do
17
+ copy_from_share "app/roles/role.rb"
18
+ end
19
+
20
+ desc "build application base context"
21
+ task :context do
22
+ copy_from_share "app/contexts/context.rb"
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,3 @@
1
+ # Base class for application contexts
2
+ class Context < Neo::DCI::Context
3
+ end
@@ -0,0 +1,4 @@
1
+ # Base class for application roles
2
+ module Role
3
+ include Neo::DCI::Role
4
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neo-dci
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-08-24 00:00:00.000000000 Z
14
+ date: 2012-11-06 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rake
@@ -83,7 +83,11 @@ files:
83
83
  - lib/neo/dci/context_result.rb
84
84
  - lib/neo/dci/data.rb
85
85
  - lib/neo/dci/role.rb
86
+ - lib/neo/dci/task_loader.rb
86
87
  - lib/neo/dci/version.rb
88
+ - lib/tasks/neo-dci_tasks.rake
89
+ - lib/tasks/share/app/contexts/context.rb
90
+ - lib/tasks/share/app/roles/role.rb
87
91
  - neo-dci.gemspec
88
92
  - test/context_result_test.rb
89
93
  - test/context_test.rb