dbinbox 0.0.1 → 0.0.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.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dbinbox (0.0.1)
4
+ dbinbox (0.0.2)
5
5
  rest-client (~> 1.6.7)
6
6
 
7
7
  GEM
data/Rakefile CHANGED
@@ -1,5 +1,6 @@
1
1
  # rake build # Build -.gem into the pkg directory
2
2
  # rake install # Build and install -.gem into system gems
3
3
  # rake release # Create tag v0.1.1 and build and push -.gem to Rubygems
4
+ # gem push pkg/dbinbox-0.0.1.gem
4
5
 
5
6
  require "bundler/gem_tasks"
@@ -26,6 +26,7 @@ class Dbinbox
26
26
  # @param [String] username the username (and optional path) that items are sent to
27
27
  # @param [Array] args an array of files, strings, and directories to be uploaded
28
28
  def self.send(username, args)
29
+ # url = "http://127.0.0.1:9393/send/#{username}"
29
30
  url = "http://dbinbox.com/send/#{username}"
30
31
 
31
32
  # force args to an array
@@ -40,10 +41,18 @@ class Dbinbox
40
41
  elsif File.exists?(arg)
41
42
  u = url + arg.sub(File.basename(arg), '')
42
43
  STDERR.puts "Uploading #{arg} to #{u}"
43
- RestClient.post(u, "files[]" => File.new(arg))
44
+ begin
45
+ res = RestClient.post(u, "files[]" => File.new(arg))
46
+ rescue RestClient::ResourceNotFound
47
+ STDERR.puts "Error: user not found"
48
+ end
44
49
  else
45
50
  STDERR.puts "Sending \"#{arg}\" to #{url}"
46
- RestClient.post(url, "message" => arg)
51
+ begin
52
+ res = RestClient.post(url, "message" => arg)
53
+ rescue RestClient::ResourceNotFound
54
+ STDERR.puts "Error: user not found"
55
+ end
47
56
  end
48
57
  }
49
58
  end
@@ -1,3 +1,3 @@
1
1
  module Dbinbox
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dbinbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -95,7 +95,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
95
95
  version: '0'
96
96
  segments:
97
97
  - 0
98
- hash: -2082758460685036002
98
+ hash: 654618066126843918
99
99
  required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  none: false
101
101
  requirements:
@@ -104,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  version: '0'
105
105
  segments:
106
106
  - 0
107
- hash: -2082758460685036002
107
+ hash: 654618066126843918
108
108
  requirements: []
109
109
  rubyforge_project:
110
110
  rubygems_version: 1.8.24