fastlyctl 1.0.11 → 1.0.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9c0c20fe758873efe396f68d050d11c8c3675f352918a2a9a9ba55d4a334879f
4
- data.tar.gz: 70d29a51e74acffa02ff2a330694cb86d1a6d262cbc95d2967440a0777c61601
3
+ metadata.gz: 1c154207a0e8cd59c7181d3e4b49c14fe6e6a437b7b6e01a597e5e9f1657b0ec
4
+ data.tar.gz: 8dc202ac070b547244e84774a7d7383886317b69853c08b6f39408b995969e66
5
5
  SHA512:
6
- metadata.gz: a75044ca703cb25c00b3968f2d8a59936f8bbc54af13b02480ea273b4a85b5da5cdd76bf51c828f2d73e9452c8e3538133471b79c01e3424c0fb35afcdf8df21
7
- data.tar.gz: 1db8c990dd3cb81fec5e6bb92f6b9b2e0dd8f1a3b03d522c0e573f1fe1617d4ab17c4c006f7a188e43b8d9e38747f6f794e996d17c5b8859e64eba0bf6da5f98
6
+ metadata.gz: cbcf3d02d17fea022de0d7fd573b52aeae06d529933f20848267ab6b73ed885774a3958d6f39812e51ea49f2cb29ca35b8a6aa4deea278b4b0727ff2f7cdd66d
7
+ data.tar.gz: a91b8cf084a34e5c2af34b4540fbe1622cede5590b7eef8c1e280414b2ac6112b7bfebf9964851236b6eb6b814ac99ecee588b4e629a3d088357180d9439c00c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fastlyctl (1.0.11)
4
+ fastlyctl (1.0.12)
5
5
  diffy (~> 3.2.1)
6
6
  launchy (~> 2.4.3, >= 2.4.3)
7
7
  thor (~> 0.19.4)
data/README.md CHANGED
@@ -1,12 +1,14 @@
1
1
  # FastlyCTL [![Gem Version](https://img.shields.io/gem/v/fastlyctl.svg)](https://rubygems.org/gems/fastlyctl)
2
2
 
3
- CLI for manipulating objects with [Fastly's API](https://docs.fastly.com/api/config).
3
+ A CLI for managing Fastly configurations with [Fastly's API](https://docs.fastly.com/api/config).
4
4
 
5
5
  ## Dependencies
6
6
 
7
7
  * Ruby 2.2+
8
- * diff
9
- * Bundler
8
+ * [diffy](https://rubygems.org/gems/diffy)
9
+ * [launchy](https://rubygems.org/gems/launchy)
10
+ * [thor](https://rubygems.org/gems/thor)
11
+ * [typhoeus](https://rubygems.org/gems/typhoeus)
10
12
 
11
13
  ## Installation
12
14
 
@@ -317,6 +319,7 @@ Flags:
317
319
  * --v: The version to use. Latest writable version is assumed.
318
320
  * --t: The type of snippet to create. Types are named after subroutines--for instance a snippet for `vcl_recv` would be of type `recv`. Use `init` for snippets outside of a subroutine.
319
321
  * --d: When used with the create command, specifies that the snippet should be dynamic.
322
+ * --y: Answer yes to all prompts
320
323
 
321
324
  ### token
322
325
 
@@ -9,6 +9,7 @@ module FastlyCTL
9
9
  "#{basename} logging #{command.usage}"
10
10
  end
11
11
 
12
+
12
13
  desc "bigquery <action>", "Setup BigQuery As a logging provider, available actions are create, update, delete, list and show"
13
14
  method_option :service, :aliases => ["--s","--service"], :banner => "Service ID to use", :required => true
14
15
  method_option :version, :aliases => ["--v", "--version"], :banner => "Version of the service to use"
@@ -5,6 +5,7 @@ module FastlyCTL
5
5
  method_option :version, :aliases => ["--v"]
6
6
  method_option :type, :aliases => ["--t"]
7
7
  method_option :dynamic, :aliases => ["--d"]
8
+ method_option :yes, :aliases => ["--y"]
8
9
  def snippet(action,name=false)
9
10
  id = FastlyCTL::Utils.parse_directory unless options[:service]
10
11
  id ||= options[:service]
@@ -46,9 +47,10 @@ module FastlyCTL
46
47
 
47
48
  new_content = File.read(filename)
48
49
 
49
- say(FastlyCTL::Utils.get_diff(snippet["content"],new_content))
50
-
51
- abort unless yes?("Given the above diff between the old dyanmic snippet content and the new content, are you sure you want to upload your changes? REMEMBER, THIS SNIPPET IS VERSIONLESS AND YOUR CHANGES WILL BE LIVE IMMEDIATELY!")
50
+ unless options.key?(:yes)
51
+ say(FastlyCTL::Utils.get_diff(snippet["content"],new_content))
52
+ abort unless yes?("Given the above diff between the old dyanmic snippet content and the new content, are you sure you want to upload your changes? REMEMBER, THIS SNIPPET IS VERSIONLESS AND YOUR CHANGES WILL BE LIVE IMMEDIATELY!")
53
+ end
52
54
 
53
55
  FastlyCTL::Fetcher.api_request(:put, "/service/#{id}/snippet/#{snippet["snippet_id"]}", {:endpoint => :api, body: {
54
56
  content: new_content
@@ -77,7 +79,7 @@ module FastlyCTL
77
79
  return
78
80
  end
79
81
 
80
- if yes?("Local file #{filename} found. Would you like to upload its content?")
82
+ if options.key?(:yes) || yes?("Local file #{filename} found. Would you like to upload its content?")
81
83
  FastlyCTL::Fetcher.upload_snippet(id,version,File.read(filename),name)
82
84
  say("Local snippet file content successfully uploaded.")
83
85
  end
@@ -89,7 +91,7 @@ module FastlyCTL
89
91
 
90
92
  return unless File.exists?(filename)
91
93
 
92
- if yes?("Would you like to delete the local file #{name}.snippet associated with this snippet?")
94
+ if options.key?(:yes) || yes?("Would you like to delete the local file #{name}.snippet associated with this snippet?")
93
95
  File.delete(filename)
94
96
  say("Local snippet file #{filename} deleted.")
95
97
  end
@@ -1,3 +1,3 @@
1
1
  module FastlyCTL
2
- VERSION = "1.0.11"
2
+ VERSION = "1.0.12"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlyctl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.11
4
+ version: 1.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Basile
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-07-26 00:00:00.000000000 Z
11
+ date: 2019-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus