pipe2me-client 0.2.0 → 0.2.1

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
  SHA1:
3
- metadata.gz: 45f85801ad57c6402d4c6aecbe01cd335e6363e5
4
- data.tar.gz: c72fa32c04e45830226f4f5a103e112ef0448cc6
3
+ metadata.gz: f9f132b1573f1f4fb103d1862ef4a0f4c8bc70f3
4
+ data.tar.gz: 680041d4879c6b15e81e6e68c8b57d6a76ab702e
5
5
  SHA512:
6
- metadata.gz: 65c12c51649a8b1b01cdaf274012a9d3ac2accba70dff89064cc260c3c4423288fa40b2042a16f9c859eda270d5df0d789082db93d526aeb5386fc1c0ac6bb3c
7
- data.tar.gz: f934aeef86119c2feb2c5fba0c824c59366f9d79d29d77173750397ac16b11077147f8e64e5e4d6b1df10e6480020b8ede0ce166969d34d9c5f5f56b8fd23689
6
+ metadata.gz: 06cb41c0cfb69a9e275d798d0938e220092a7c8cc45eb36ac75557777598f8a825f2377d36a5162cc490e36816281f736d0c772b7de38649d97b2a01f7b6425e
7
+ data.tar.gz: d77b13376efe3a4b6bc34431b3d82d8b72190f5d1c1712b2b63fe37f792c03e38924ded69cd0274c001224ac21b52a6b08a6e29d7ee3bd13a2fba46f5a9de81a
data/lib/pipe2me/cli.rb CHANGED
@@ -3,6 +3,11 @@ require "thor"
3
3
  class Pipe2me::CLI < Thor
4
4
  def self.exit_on_failure?; true; end
5
5
 
6
+ desc "version", "print version information"
7
+ def version
8
+ puts Pipe2me::VERSION
9
+ end
10
+
6
11
  desc "setup", "fetch a new tunnel setup"
7
12
  option :server, :default => "http://test.pipe2.me:8080"
8
13
  option :auth, :required => true # "auth token"
@@ -1,16 +1,9 @@
1
1
  require "tempfile"
2
2
 
3
3
  class File
4
- def self.atomic_write(path, data=nil, &block)
5
- tmpfile = Tempfile.new(File.basename(path))
6
- tmpfile.write data if data
7
- yield(tmpfile) if block
8
- tmpfile.write data if data
9
- tmpfile.close
10
- FileUtils.mv tmpfile.path, path # atomic replace
11
- tmpfile.unlink # deletes the temp file
12
- rescue
13
- tmpfile.close! rescue nil # close and deletes the temp file
14
- raise
4
+ def self.write(path, data=nil)
5
+ open path, "w" do |io|
6
+ io.write data
7
+ end
15
8
  end
16
9
  end
@@ -5,7 +5,7 @@ module Pipe2me::ShellFormat
5
5
  extend self
6
6
 
7
7
  def write(path, data)
8
- File.atomic_write path, dump(data)
8
+ File.write path, dump(data)
9
9
  end
10
10
 
11
11
  def read(path)
@@ -24,6 +24,6 @@ module Pipe2me::Tunnel::OpenSSL
24
24
  cert = HTTP.post!("#{url}/cert.pem", File.read("#{SSL_KEY}.csr"), {'Content-Type' =>'text/plain'})
25
25
  UI.debug "received certificate:\n#{cert}"
26
26
 
27
- File.atomic_write SSL_CERT, cert
27
+ File.write SSL_CERT, cert
28
28
  end
29
29
  end
@@ -1,4 +1,4 @@
1
1
  module Pipe2me
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  BANNER = "pipe2.me command line client V#{Pipe2me::VERSION}; (c) The kink team, 2013, 2014."
4
4
  end
data/rakelib/gem.rake ADDED
@@ -0,0 +1,32 @@
1
+ # Add "rake release and rake install"
2
+ require "bundler/setup"
3
+ Bundler::GemHelper.install_tasks
4
+
5
+ task :release => :changelog
6
+
7
+ # update CHANGELOG file
8
+ task :changelog do
9
+ require "simple/ui"
10
+ FileUtils.cp "CHANGELOG.md", "CHANGELOG.old.md"
11
+ last_version = `git tag -l 'v[0-9]*' | sort -n | tail -n 1`
12
+ last_version.chomp!
13
+
14
+ current_version = `bin/pipe2me version`.chomp
15
+ UI.success "Changes from #{last_version} .. #{current_version}:"
16
+
17
+ changes = `git log --format=format:'- %s [%an]' #{last_version}..HEAD`
18
+ UI.warn "\n#{changes}\n"
19
+
20
+ system "git reset CHANGELOG.md > /dev/null"
21
+ system "git checkout CHANGELOG.md"
22
+
23
+ old_changelog = File.read "CHANGELOG.md"
24
+ File.open "CHANGELOG.md", "w" do |io|
25
+ io.write "# v#{current_version}: #{Time.now.strftime "%c"}\n\n"
26
+ io.write changes
27
+ io.write "\n\n"
28
+ io.write old_changelog
29
+ end
30
+
31
+ system "git commit -m 'Updates CHANGELOG.md' CHANGELOG.md"
32
+ end
data/rakelib/test.rake ADDED
@@ -0,0 +1,16 @@
1
+ task :test => "test:debug"
2
+ namespace :test do
3
+ # run a debug test - a test against pipe2.dev. This is the default
4
+ # test scenario.
5
+ task :debug do
6
+ FileUtils.mkdir_p "tmp"
7
+ system "TEST_ENV=debug roundup test/*-test.sh"
8
+ end
9
+
10
+ # run a release test - a test against test.pipe2.me. Please run this
11
+ # test before releasing a new version.
12
+ task :release do
13
+ FileUtils.mkdir_p "tmp"
14
+ system "TEST_ENV=release roundup test/*-test.sh"
15
+ end
16
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pipe2me-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - radiospiel
@@ -66,7 +66,7 @@ dependencies:
66
66
  - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- description: pipe2.me command line client V0.2.0; (c) The kink team, 2013, 2014.
69
+ description: pipe2.me command line client V0.2.1; (c) The kink team, 2013, 2014.
70
70
  email: contact@kinko.me
71
71
  executables:
72
72
  - pipe2me
@@ -92,6 +92,8 @@ files:
92
92
  - lib/pipe2me/tunnel/openssl.rb
93
93
  - lib/pipe2me/tunnel/ssh.rb
94
94
  - lib/pipe2me/version.rb
95
+ - rakelib/gem.rake
96
+ - rakelib/test.rake
95
97
  - test/000-roundup-test.sh
96
98
  - test/auth-token-test.sh
97
99
  - test/env-test.sh
@@ -127,5 +129,5 @@ rubyforge_project:
127
129
  rubygems_version: 2.2.1
128
130
  signing_key:
129
131
  specification_version: 4
130
- summary: pipe2.me command line client V0.2.0; (c) The kink team, 2013, 2014.
132
+ summary: pipe2.me command line client V0.2.1; (c) The kink team, 2013, 2014.
131
133
  test_files: []