anvil-cli 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/anvil/builder.rb CHANGED
@@ -27,6 +27,8 @@ class Anvil::Builder
27
27
 
28
28
  req = Net::HTTP::Post.new uri.request_uri
29
29
 
30
+ req.initialize_http_header "User-Agent" => Anvil.agent
31
+
30
32
  req.set_form_data({
31
33
  "buildpack" => options[:buildpack],
32
34
  "cache" => options[:cache],
@@ -59,7 +61,11 @@ class Anvil::Builder
59
61
  private
60
62
 
61
63
  def anvil
62
- @anvil ||= RestClient::Resource.new(anvil_host)
64
+ @anvil ||= RestClient::Resource.new(anvil_host, :headers => anvil_headers)
65
+ end
66
+
67
+ def anvil_headers
68
+ { "User-Agent" => Anvil.agent }
63
69
  end
64
70
 
65
71
  def anvil_host
@@ -35,6 +35,9 @@ class Anvil::Manifest
35
35
 
36
36
  env = options[:env] || {}
37
37
 
38
+ req.initialize_http_header "User-Agent" => Anvil.agent
39
+ req["User-Agent"] = Anvil.agent
40
+
38
41
  req.set_form_data({
39
42
  "buildpack" => options[:buildpack],
40
43
  "cache" => @cache_url,
@@ -105,7 +108,11 @@ class Anvil::Manifest
105
108
  private
106
109
 
107
110
  def anvil
108
- @anvil ||= RestClient::Resource.new(anvil_host)
111
+ @anvil ||= RestClient::Resource.new(anvil_host, :headers => anvil_headers)
112
+ end
113
+
114
+ def anvil_headers
115
+ { "User-Agent" => Anvil.agent }
109
116
  end
110
117
 
111
118
  def anvil_host
data/lib/anvil/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Anvil
2
- VERSION = "0.6.0"
2
+ VERSION = "0.7.0"
3
3
  end
data/lib/anvil.rb CHANGED
@@ -1,2 +1,13 @@
1
+ require "anvil/version"
2
+
1
3
  module Anvil
4
+
5
+ def self.agent
6
+ @@agent ||= "anvil-cli version=#{Anvil::VERSION}"
7
+ end
8
+
9
+ def self.append_agent(str)
10
+ @@agent = self.agent + " " + str
11
+ end
12
+
2
13
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anvil-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-09-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: progress
16
- requirement: &70289393156440 !ruby/object:Gem::Requirement
16
+ requirement: &70326362091620 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 2.4.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70289393156440
24
+ version_requirements: *70326362091620
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rest-client
27
- requirement: &70289393155460 !ruby/object:Gem::Requirement
27
+ requirement: &70326362091060 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.6.7
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70289393155460
35
+ version_requirements: *70326362091060
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: thor
38
- requirement: &70289393154640 !ruby/object:Gem::Requirement
38
+ requirement: &70326362090460 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: 0.15.2
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70289393154640
46
+ version_requirements: *70326362090460
47
47
  description: Alternate Heroku build workflow
48
48
  email: david@dollar.io
49
49
  executables: