fastly 1.1.0 → 1.1.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 32433fc4e1827f9659e820237e1169cd7daac028
4
- data.tar.gz: 10af32d40745105a372f0701d8dbe248d679ec8c
3
+ metadata.gz: 7185290c285aff8cefd7d9285f43f3e245051e2d
4
+ data.tar.gz: 70e9c38148ce099176ae05fc712a0b046b542e47
5
5
  SHA512:
6
- metadata.gz: 9d9206b598514df93cb6ea04802fbe25cfeff699037d37881655323a893757c357695356fed7c45f162844acd3757f92c7d4f41c822112aa64ff7aa88edd2696
7
- data.tar.gz: 26ec2fb0e1fb0ee4633f09a3e4203dc342b2c235c474f637d8f13ed620a48e9c5ae180bff79b9de4bfb7b26e0e2f97354205d117a1b5170efb0ffc55a183709f
6
+ metadata.gz: 75e37814b6bc25c1317086e90ad0743298d6680597bb78f1dcc13497baa698a950b560f7a67b3b5d062797cc71712b269554c371685a626e523eccf27cf6b6c9
7
+ data.tar.gz: c01bcc6cca3b593c849a2bce956f3fe90741fead91100cadd8d2011baab80a78e32f8d092cddf27d75cf8ea4576e0dbadd65eaed7ecae06165baef490599ab1c
data/Gemfile CHANGED
@@ -1,4 +1,9 @@
1
- source "http://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
 
3
- # Specify your gem's dependencies in fastly.gemspec
4
3
  gemspec
4
+
5
+ group :development, :test do
6
+ gem 'rake', '~> 10.3.2'
7
+ gem 'rdoc', '~> 4.1.1'
8
+ gem 'minitest', '~> 5.3.4'
9
+ end
data/README.md CHANGED
@@ -53,7 +53,7 @@ director.add_backend(new_backend)
53
53
  # ... and upload some custom vcl (presuming we have permissions)
54
54
  new_version.upload_vcl(vcl_name, File.read(vcl_file))
55
55
  # ... and set it as the service's main vcl
56
- fastly.client.put("/service/#{service.id}/version/#{new_version.number}/vcl/#{vcl_name}/main")
56
+ new_version.vcl(vcl_name).set_main!
57
57
 
58
58
  new_version.activate!
59
59
  ```
data/Rakefile CHANGED
@@ -1,10 +1,17 @@
1
1
  require 'bundler/gem_tasks'
2
2
  require 'rake/testtask'
3
+ require 'rdoc/task'
3
4
 
4
- task :default => :test
5
+ RDoc::Task.new do |rdoc|
6
+ rdoc.rdoc_dir = 'doc'
7
+ rdoc.main = 'README.md'
8
+ rdoc.rdoc_files.include('README.md', 'lib/**/*.rb')
9
+ end
5
10
 
6
11
  Rake::TestTask.new do |t|
7
- t.libs << "test"
12
+ t.libs << 'test'
8
13
  t.test_files = FileList['test/*test.rb']
9
14
  t.verbose = true
10
15
  end
16
+
17
+ task default: :test
@@ -13,13 +13,10 @@ Gem::Specification.new do |s|
13
13
  s.license = 'MIT'
14
14
 
15
15
  s.files = `git ls-files`.split("\n")
16
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
+ s.test_files = `git ls-files -- test/*`.split("\n")
17
17
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
18
  s.require_paths = ["lib"]
19
19
 
20
- s.add_dependency 'rake'
21
- s.add_dependency 'json'
22
20
  s.add_dependency 'curb', '>=0.7.15'
23
21
  s.add_dependency 'curb-fu', '>=0.6.1'
24
- s.add_development_dependency 'rdoc', '>=3.4'
25
22
  end
@@ -1,4 +1,4 @@
1
1
  class Fastly
2
2
  # The current version of the library
3
- VERSION = "1.1.0"
3
+ VERSION = "1.1.1"
4
4
  end
@@ -1,13 +1,19 @@
1
1
  class Fastly
2
2
  # An internal representation of a Varnish Configuration Language file
3
3
  class VCL < BelongsToServiceAndVersion
4
- attr_accessor :service_id, :name, :content, :comment
4
+ attr_accessor :service_id, :name, :content, :comment, :main
5
5
  ##
6
6
  # :attr: service_id
7
7
  #
8
8
  # The id of the service this belongs to.
9
9
  #
10
10
 
11
+ ##
12
+ # :attr: name
13
+ #
14
+ # The name of the uploaded VCL
15
+ #
16
+
11
17
  ##
12
18
  # :attr: version
13
19
  #
@@ -24,5 +30,21 @@ class Fastly
24
30
  # :attr: comment
25
31
  #
26
32
  # a free form comment field
33
+ #
34
+
35
+ ##
36
+ # :attr: main
37
+ #
38
+ # A boolean indicating if some specific VCL is the main VCL
39
+ #
40
+
41
+ ##
42
+ #
43
+ # Set VCL as main VCL
44
+ #
45
+ def set_main!
46
+ hash = fetcher.client.put("/service/#{service.id}/version/#{version_number}/vcl/#{name}/main")
47
+ !hash.nil?
48
+ end
27
49
  end
28
- end
50
+ end
@@ -126,6 +126,11 @@ class Fastly
126
126
  return Fastly::VCL.new(hash, fetcher)
127
127
  end
128
128
 
129
+ # Upload a VCL file for this Version and set as the main VCL
130
+ def upload_main_vcl(name, contents)
131
+ upload_vcl(name, contents).set_main!
132
+ end
133
+
129
134
  # Get the named VCL for this version
130
135
  #
131
136
  # Won't return the content of the VCL unless you pass in
metadata CHANGED
@@ -1,43 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastly
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fastly Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-04 00:00:00.000000000 Z
11
+ date: 2014-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: rake
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: json
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
13
  - !ruby/object:Gem::Dependency
42
14
  name: curb
43
15
  requirement: !ruby/object:Gem::Requirement
@@ -66,20 +38,6 @@ dependencies:
66
38
  - - ">="
67
39
  - !ruby/object:Gem::Version
68
40
  version: 0.6.1
69
- - !ruby/object:Gem::Dependency
70
- name: rdoc
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '3.4'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '3.4'
83
41
  description: Client library for the Fastly acceleration system
84
42
  email:
85
43
  - support@fastly.com