serf-td-agent 0.1.0 → 0.1.2

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: 952b4e4179ed81673e740da2829c697bfe8a65d6
4
- data.tar.gz: c71b2162b68341a7017a61a8f9c00b03cfb4d1df
3
+ metadata.gz: e4178df0cba89bdc39c46fe72ce29c333d400b36
4
+ data.tar.gz: 04f77bdb843c3813f2413f0b809c08b6b11ceeca
5
5
  SHA512:
6
- metadata.gz: 14af2d9b29e1d6799658e9db80db8ce11c43c998eee60f63980e38af8302ff979930a5eae5e2d24bde999569931df00c7971b825e94a7db61aba91c26109f4f6
7
- data.tar.gz: e32d5979b39a7f62e9c76f169c320844acd46c3639afe30cd71ec70d306cca061298fb973ccd0ed3626693fa5ace0b32b6d61698b7eb00dac45dad03c3015ac2
6
+ metadata.gz: ca074d0fb15ed2509a0a235da2757a0f3a171375e98125e907cd644ad8d561b44ec91565c6da2ec9fb5ef3ef502d9d325952590ce0b24d864730f3a91013c85d
7
+ data.tar.gz: 39092875c039c64611c315cced8cb6ef45e73463348af648e3ee2e6bb44fb88331d3fe35e379fe641b08f10e547989ceb9d039d3bbf42e183fc461e7929605d9
data/.gitignore CHANGED
@@ -3,3 +3,4 @@ Makefile
3
3
  *.zip
4
4
  tmp/*
5
5
  Gemfile.lock
6
+ bin/serf
@@ -1,3 +1,15 @@
1
+ ## 0.1.2 (2014/05/24)
2
+
3
+ Fixes:
4
+
5
+ * Fix to restore permission on unzip
6
+
7
+ ## 0.1.1 (2014/05/24)
8
+
9
+ Changes:
10
+
11
+ * Use ruby instead of curl for the automatic download
12
+
1
13
  ## 0.1.0 (2014/05/22)
2
14
 
3
15
  First version
@@ -2,9 +2,29 @@ require 'mkmf'
2
2
  # I actually do not need this, but it looks gem install requires Makefile anyway
3
3
  create_makefile('serf-td-agent')
4
4
 
5
- # curl --insecure --silent -L -O https://dl.bintray.com/mitchellh/serf/0.6.0_linux_amd64.zip
6
- CURL_CMD="curl --insecure --silent -L -O"
7
- SERF_BASEURI="https://dl.bintray.com/mitchellh/serf"
5
+ def http_download(uri, dest = nil)
6
+ require 'open-uri'
7
+ require 'openssl'
8
+ dest ||= File.basename(uri)
9
+ open(dest, 'wb') do |file|
10
+ open(uri, ssl_verify_mode: OpenSSL::SSL::VERIFY_NONE, redirect: true) do |data|
11
+ file.write(data.read)
12
+ end
13
+ end
14
+ end
15
+
16
+ def unzip(zip_file, dest = '.')
17
+ require 'zip/zip'
18
+ Zip::ZipFile.open(zip_file) do |zip|
19
+ zip.each do |entry|
20
+ entry.restore_permissions = true
21
+ entry.extract("#{dest}/#{entry.to_s}") { true } # true to overwrite
22
+ end
23
+ end
24
+ end
25
+
26
+ # http://dl.bintray.com/mitchellh/serf/0.6.0_linux_amd64.zip
27
+ SERF_BASEURI="http://dl.bintray.com/mitchellh/serf"
8
28
  SERF_VERSION="0.6.0"
9
29
 
10
30
  os, arch = nil, nil
@@ -12,7 +32,7 @@ case RUBY_PLATFORM
12
32
  when /linux/
13
33
  os = 'linux'
14
34
  when /darwin/
15
- os = 'darwon'
35
+ os = 'darwin'
16
36
  when /mingw|win32/
17
37
  os = 'windows'
18
38
  when /freebsd/
@@ -28,5 +48,5 @@ when /arm/
28
48
  end
29
49
 
30
50
  zip_filename = "#{SERF_VERSION}_#{os}_#{arch}.zip"
31
- system "#{CURL_CMD} #{SERF_BASEURI}/#{zip_filename}"
32
- system "unzip #{zip_filename} -d #{File.expand_path('../../../bin', __FILE__)}"
51
+ http_download("#{SERF_BASEURI}/#{zip_filename}")
52
+ unzip(zip_filename, "#{File.expand_path('../../../bin', __FILE__)}")
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "serf-td-agent"
6
- s.version = "0.1.0"
6
+ s.version = "0.1.2"
7
7
  s.authors = ["Naotoshi Seo"]
8
8
  s.email = ["sonots@gmail.com"]
9
9
  s.homepage = "http://github.com/sonots/serf-td-agent"
@@ -18,5 +18,6 @@ Gem::Specification.new do |s|
18
18
  # s.require_paths = ["lib"]
19
19
 
20
20
  s.add_runtime_dependency "gem-path", '~> 0'
21
+ s.add_runtime_dependency "rubyzip", '~> 0'
21
22
  s.add_development_dependency "rake", '~> 0'
22
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: serf-td-agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naotoshi Seo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-22 00:00:00.000000000 Z
11
+ date: 2014-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem-path
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubyzip
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'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rake
29
43
  requirement: !ruby/object:Gem::Requirement