fontana_client_support 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ N2MxNjA3NzI1OGZiODcyNDU5ZTZiNzZiOWFkYWZjZTYyNjViYzliOA==
5
+ data.tar.gz: !binary |-
6
+ ZjNmYTU0NDkwY2UwNWE1NzE3MjU1N2UwMDQ2OTNjZWE3NjkyMGMwMw==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ YTBjZGU4ZDgyNWJhMmJmMjBjMTUwNzliNGU0MWFkOTdiYjg1MWM5OGQwODQy
10
+ MjYwYTZmYjA3YWUyOTRlYzA3ODg0ZWNlN2NkNzE5MmEwOTdjNGZiYjhkNjdm
11
+ YzRlODEwMmJhMTc0OWMzNzNkMGUwZTk5MjEyZGE3NzgzMGM5Y2Y=
12
+ data.tar.gz: !binary |-
13
+ N2Q5MzI1ZTVkZjJjNGM1MzIwZmNlMTBjZjhlNzEyZDFkODY0ZmMyNDIzMGJi
14
+ OTUzODVjNjMwMDFkNDE1MWI3NTZjYmIzODNlNmI1ZGFhNDJjZTk2ZTY0ODE3
15
+ ODliMjE2N2UxNjY1MjgwMjdmZDRmZDg0OGZiZTc5NGNlYjdmNGE=
@@ -1,3 +1,5 @@
1
+ require 'fontana'
2
+
1
3
  module Fontana
2
4
  module CommandUtils
3
5
 
@@ -0,0 +1,30 @@
1
+ require 'fontana'
2
+
3
+ module Fontana
4
+ module RakeUtils
5
+
6
+ class << self
7
+ def enable_task_delegate
8
+ unless Rake::Task.ancestors.include?(Fontana::RakeUtils::Delegatable)
9
+ Rake::Task.send(:include, Fontana::RakeUtils::Delegatable)
10
+ end
11
+ end
12
+ end
13
+
14
+ module Delegatable
15
+ def delegate
16
+ self.prerequisite_tasks.each(&:delegate)
17
+ execute
18
+ end
19
+ end
20
+
21
+ def task_sequential(name, task_names)
22
+ Fontana::RakeUtils.enable_task_delegate
23
+ task(name) do
24
+ task_names.each do |name|
25
+ Rake::Task[name.to_s].delegate
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -1,3 +1,5 @@
1
+ require 'fontana'
2
+
1
3
  module Fontana
2
4
  module ServerRake
3
5
 
data/lib/fontana.rb CHANGED
@@ -3,6 +3,7 @@
3
3
  module Fontana
4
4
  autoload :CommandUtils, 'fontana/command_utils'
5
5
  autoload :ServerRake , 'fontana/server_rake'
6
+ autoload :RakeUtils , 'fontana/rake_utils'
6
7
 
7
8
  class << self
8
9
  # attr_accessor :home
@@ -1,14 +1,32 @@
1
+ # -*- coding: utf-8 -*-
1
2
  require 'fontana_client_support'
2
3
  include Fontana::ServerRake
4
+ include Fontana::RakeUtils
3
5
 
4
6
  namespace :vendor do
5
7
  namespace :fontana do
6
8
 
7
9
  task :clear do
8
- FileUtils.rm_rf(FontanaClientSupport.vendor_fontana)
10
+ d = FontanaClientSupport.vendor_fontana
11
+ FileUtils.rm_rf(d) if Dir.exist?(d)
9
12
  end
10
13
 
11
- task :clone => :"vendor:fontana:clear" do
14
+ # 動的に決まるタスクを静的に扱えるようにタスクを定義します
15
+ task :deploy_reset do
16
+ Rake::Task["deploy:#{FontanaClientSupport.deploy_strategy}:reset"].delegate
17
+ end
18
+ task :deploy_update do
19
+ Rake::Task["deploy:#{FontanaClientSupport.deploy_strategy}:update"].delegate
20
+ end
21
+
22
+ task_sequential :setup, [
23
+ :"vendor:fontana:clone",
24
+ :"vendor:fontana:configs",
25
+ :"vendor:fontana:bundle_install",
26
+ :"vendor:fontana:deploy_reset",
27
+ ]
28
+
29
+ task :clone do
12
30
  raise "$FONTANA_REPO_URL is required" unless Fontana.repo_url
13
31
  FileUtils.mkdir_p(FontanaClientSupport.vendor_dir)
14
32
  Dir.chdir(FontanaClientSupport.root_dir) do
@@ -16,33 +34,57 @@ namespace :vendor do
16
34
  end
17
35
  Dir.chdir(FontanaClientSupport.vendor_fontana) do
18
36
  system!("git checkout #{Fontana.branch}")
19
- FileUtils.cp(File.join(FontanaClientSupport.root_dir, "spec/server_config/mongoid.yml"), "config/mongoid.yml")
37
+ end
38
+ end
39
+
40
+ task :configs do
41
+ Dir.chdir(FontanaClientSupport.vendor_fontana) do
42
+ [
43
+ File.join(FontanaClientSupport.root_dir, "config/fontana_mongoid.yml"),
44
+ "config/project.yml.erb.example"
45
+ ].each do |path|
46
+ if File.readable?(path)
47
+ FileUtils.cp(path, "config/mongoid.yml")
48
+ break
49
+ end
50
+ end
20
51
  FileUtils.cp("config/project.yml.erb.example", "config/project.yml.erb")
52
+ end
53
+ end
54
+
55
+ task :bundle_install do
56
+ Dir.chdir(FontanaClientSupport.vendor_fontana) do
21
57
  system!("BUNDLE_GEMFILE=#{Fontana.gemfile} bundle install")
22
58
  end
23
- Rake::Task["deploy:#{FontanaClientSupport.deploy_strategy}:reset"].execute
24
59
  end
25
60
 
26
- task :update do
61
+ task_sequential :update, [
62
+ :"vendor:fontana:fetch_and_checkout",
63
+ :"vendor:fontana:bundle_install",
64
+ :"vendor:fontana:db_drop",
65
+ :"vendor:fontana:deploy_update",
66
+ ]
67
+
68
+ task :fetch_and_checkout do
27
69
  Dir.chdir(FontanaClientSupport.vendor_fontana) do
28
70
  system!("git fetch origin")
29
71
  system!("git checkout origin/#{Fontana.branch}")
30
- system!("BUNDLE_GEMFILE=#{Fontana.gemfile} bundle install")
31
- system!("BUNDLE_GEMFILE=#{Fontana.gemfile} bundle exec rake db:drop")
32
72
  end
33
- Rake::Task["deploy:#{FontanaClientSupport.deploy_strategy}:update"].execute
34
73
  end
35
74
 
36
- task :prepare do
37
- if Dir.exist?(FontanaClientSupport.vendor_fontana)
38
- Rake::Task["vendor:fontana:update"].execute
39
- else
40
- Rake::Task["vendor:fontana:clone"].execute
75
+ task :db_drop do
76
+ Dir.chdir(FontanaClientSupport.vendor_fontana) do
77
+ system!("BUNDLE_GEMFILE=#{Fontana.gemfile} bundle exec rake db:drop")
41
78
  end
42
79
  end
43
80
 
44
81
  desc "reset vendor/fontana"
45
- task :reset => [:"vendor:fontana:clear", :"vendor:fontana:clone"]
82
+ task_sequential :reset, [:"vendor:fontana:clear", :"vendor:fontana:setup"]
83
+
84
+ task :prepare do
85
+ name = Dir.exist?(FontanaClientSupport.vendor_fontana) ? "update" : "reset"
86
+ Rake::Task["vendor:fontana:#{name}"].delegate
87
+ end
46
88
  end
47
89
 
48
90
  end
@@ -1,3 +1,3 @@
1
1
  module FontanaClientSupport
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fontana_client_support
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
5
- prerelease:
4
+ version: 0.3.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - akima
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-07-03 00:00:00.000000000 Z
11
+ date: 2013-07-04 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ! '>='
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ! '>='
44
39
  - !ruby/object:Gem::Version
@@ -58,6 +53,7 @@ files:
58
53
  - fontana_client_support.gemspec
59
54
  - lib/fontana.rb
60
55
  - lib/fontana/command_utils.rb
56
+ - lib/fontana/rake_utils.rb
61
57
  - lib/fontana/server_rake.rb
62
58
  - lib/fontana_client_support.rb
63
59
  - lib/fontana_client_support/tasks.rb
@@ -71,27 +67,26 @@ files:
71
67
  homepage: ''
72
68
  licenses:
73
69
  - MIT
70
+ metadata: {}
74
71
  post_install_message:
75
72
  rdoc_options: []
76
73
  require_paths:
77
74
  - lib
78
75
  required_ruby_version: !ruby/object:Gem::Requirement
79
- none: false
80
76
  requirements:
81
77
  - - ! '>='
82
78
  - !ruby/object:Gem::Version
83
79
  version: '0'
84
80
  required_rubygems_version: !ruby/object:Gem::Requirement
85
- none: false
86
81
  requirements:
87
82
  - - ! '>='
88
83
  - !ruby/object:Gem::Version
89
84
  version: '0'
90
85
  requirements: []
91
86
  rubyforge_project:
92
- rubygems_version: 1.8.25
87
+ rubygems_version: 2.0.3
93
88
  signing_key:
94
- specification_version: 3
89
+ specification_version: 4
95
90
  summary: gem to support development and testing with GSS/fontana
96
91
  test_files: []
97
92
  has_rdoc: