fontana_client_support 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,6 +12,16 @@ module FontanaClientSupport
12
12
  def vendor_fontana
13
13
  @vendor_fontana ||= File.join(vendor_dir, "fontana")
14
14
  end
15
+
16
+ def current_branch_name
17
+ @current_branch_name ||= `git log --decorate -1`.scan(/^commit\s[0-9a-f]+\s\((.+)\)/).
18
+ flatten.first.split(/,/).map(&:strip).select{|s| s =~ /origin\//}.
19
+ reject{|s| s == "origin/HEAD"}.first.sub(/\Aorigin\//, '')
20
+ end
21
+
22
+ def repo_url
23
+ @repo_url ||= `git remote -v`.scan(/origin\s+(.+?)\s/).flatten.uniq.first
24
+ end
15
25
  end
16
26
  end
17
27
 
@@ -4,8 +4,8 @@ include Fontana::ServerRake
4
4
  namespace_with_fontana :deploy, :"app:deploy" do
5
5
 
6
6
  set_url_and_branch = ->{
7
- ENV['URL'] ||= `git remote -v`.scan(/origin\s+(.+?)\s/).flatten.uniq.first
8
- ENV['BRANCH'] ||= `git status`.scan(/^.+\sbranch\s(.+)\s*$/).flatten.first
7
+ ENV['URL'] ||= FontanaClientSupport.repo_url
8
+ ENV['BRANCH'] ||= FontanaClientSupport.current_branch_name
9
9
  }
10
10
 
11
11
  desc "deploy:setup deploy:update"
@@ -15,5 +15,5 @@ namespace_with_fontana :deploy, :"app:deploy" do
15
15
  fontana_task :setup, before: set_url_and_branch
16
16
 
17
17
  desc "fetch, checkout, build app_seed and migrate."
18
- fontana_task :update
18
+ fontana_task :update, before: set_url_and_branch
19
19
  end
@@ -13,8 +13,8 @@ namespace :vendor do
13
13
  task :clone => :"vendor:fontana:clear" do
14
14
  raise "$FONTANA_REPO_URL is required" unless Fontana.repo_url
15
15
  FileUtils.mkdir_p(FontanaClientSupport.vendor_dir)
16
- Dir.chdir(FontanaClientSupport.vendor_dir) do
17
- system!("git clone #{Fontana.repo_url}")
16
+ Dir.chdir(FontanaClientSupport.root_dir) do
17
+ system!("git clone #{Fontana.repo_url} vendor/fontana")
18
18
  end
19
19
  Dir.chdir(FontanaClientSupport.vendor_fontana) do
20
20
  system!("git checkout #{Fontana.branch}")
@@ -1,3 +1,3 @@
1
1
  module FontanaClientSupport
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fontana_client_support
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - akima
@@ -13,6 +14,7 @@ dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: bundler
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
19
  - - ~>
18
20
  - !ruby/object:Gem::Version
@@ -20,6 +22,7 @@ dependencies:
20
22
  type: :development
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
27
  - - ~>
25
28
  - !ruby/object:Gem::Version
@@ -27,6 +30,7 @@ dependencies:
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: rake
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
35
  - - ! '>='
32
36
  - !ruby/object:Gem::Version
@@ -34,6 +38,7 @@ dependencies:
34
38
  type: :development
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
43
  - - ! '>='
39
44
  - !ruby/object:Gem::Version
@@ -66,26 +71,27 @@ files:
66
71
  homepage: ''
67
72
  licenses:
68
73
  - MIT
69
- metadata: {}
70
74
  post_install_message:
71
75
  rdoc_options: []
72
76
  require_paths:
73
77
  - lib
74
78
  required_ruby_version: !ruby/object:Gem::Requirement
79
+ none: false
75
80
  requirements:
76
81
  - - ! '>='
77
82
  - !ruby/object:Gem::Version
78
83
  version: '0'
79
84
  required_rubygems_version: !ruby/object:Gem::Requirement
85
+ none: false
80
86
  requirements:
81
87
  - - ! '>='
82
88
  - !ruby/object:Gem::Version
83
89
  version: '0'
84
90
  requirements: []
85
91
  rubyforge_project:
86
- rubygems_version: 2.0.3
92
+ rubygems_version: 1.8.25
87
93
  signing_key:
88
- specification_version: 4
94
+ specification_version: 3
89
95
  summary: gem to support development and testing with GSS/fontana
90
96
  test_files: []
91
97
  has_rdoc:
checksums.yaml DELETED
@@ -1,15 +0,0 @@
1
- ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MTAxZDE3MzhkM2VjMDQ2YWY1MzdjNzVlNzc5ZjYwNjZhMGUxOGQzNw==
5
- data.tar.gz: !binary |-
6
- MzczYTQ4MTlhOWQ1YjA0Mjg2NjlmOTE2MmZmMTdjOWFlMmQxYWRhZA==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- OWY2YzdlZWM0NjQzMTc3OTg0M2RjYjYxMWY1NTcwNjllNjg4YjFhZWJlMzg2
10
- MzM5YTIwZTIyODYyNzRlNjQ0OTJiNDY1YjE4ODNjOTBjMjVjMDc0OWU4Yjkw
11
- OTQzZGQyNmY1MDM5OTUwNWU5Zjc0ZGUxZDZiYTZkNTEwNmNkOTc=
12
- data.tar.gz: !binary |-
13
- MjlmMTcyNGQxZTVkOTM1NzZhZWM1NDU3MDIzMzdiNGI2Y2ZlNGI1Mjg4YzU4
14
- NTJkMGQyOGI2NzdjZjc4MGUyM2JkY2JhNTMyNjNjNDVjOTQxY2U5MTdiYmQw
15
- NDI1YzRjNTg4NmU0NTJiYjNkZmFjNmU0NTA1ZTdhY2NhNjU4NTQ=