cloudapp 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cloudapp (0.0.4)
4
+ cloudapp (0.0.6)
5
5
  addressable
6
6
  faraday (~> 0.8.0.rc2)
7
7
  formatador
data/README.md CHANGED
@@ -18,26 +18,27 @@ goal of `cloudapp` is to be simple and Unix-friendly.
18
18
 
19
19
  ### Installation
20
20
 
21
- Installation is done via RubyGems: `gem install cloudapp`.
21
+ Installation is done via RubyGems: `gem install cloudapp`
22
22
 
23
23
  ### Usage
24
24
 
25
- - Bookmark a link: `cloudapp new bookmark http://getcloudapp.com`
26
- - Share a file: `cloudapp new file screenshot.png`
25
+ - Bookmark a link: `cloudapp bookmark http://getcloudapp.com`
26
+ - Share a file: `cloudapp upload screenshot.png`
27
27
  - List newest drops: `cloudapp list [--count=5]`
28
28
 
29
29
  ### Wish List
30
30
 
31
31
  Some baseic features that should be added:
32
32
 
33
- - Download a drop: `cloudapp download http://cl.ly/abc123`
33
+ - Share several files: `cloudapp upload *.png`
34
34
 
35
35
  A little more flare would be swell.
36
36
 
37
- - Share several files: `cloudapp new *.png`
38
- - Archive and share several files: `cloudapp new --archive *.png`
39
- - Share everything at once: `cloudapp new http://google.com *.png http://bing.com`
40
- - Encrypt and share a file: `cloudapp new --encrypt launch_codes.txt`
37
+ - Download a drop: `cloudapp download http://cl.ly/abc123`
38
+ - List specific columns: `cloudapp list --columns=name,views,link`
39
+ - Handle input from STDIN: `pbpaste | cloudapp bookmark -`
40
+ - Archive and share several files: `cloudapp upload --archive *.png`
41
+ - Encrypt and share a file: `cloudapp upload --encrypt launch_codes.txt`
41
42
  - Download and decrypt and encrypted drop: `cloudapp download http://cl.ly/abc123 def456`
42
43
 
43
44
  While we're dreaming, what could you do if it kept a local copy of all your
@@ -69,10 +70,10 @@ Cloud.app preference:
69
70
  defaults write com.linebreak.CloudAppMacOSX CLUploadShouldCopyExternallyUploadedItems -bool YES
70
71
  ```
71
72
 
72
- Now the link to every new drop shared with your account--even using a tool other
73
- than the Mac app--will be copied to your Mac's clipboard. If you're using the
74
- [stand-alone version][stand-alone] of Cloud.app and not
75
- [the Mac App Store version][mas], use the domain
73
+ Now after restarting Cloud.app, the link to every new drop shared with your
74
+ account--even using a tool other than the Mac app--will be copied to your Mac's
75
+ clipboard. If you're using the [stand-alone version][stand-alone] of Cloud.app
76
+ and not [the Mac App Store version][mas], use the domain
76
77
  `com.linebreak.CloudAppMacOSXSparkle`.
77
78
 
78
79
  [stand-alone]: http://getcloudapp.com/download
data/bin/cloudapp CHANGED
@@ -7,12 +7,12 @@ require 'main'
7
7
  # causes main to not require it.
8
8
  require 'yaml'
9
9
 
10
+ require 'cloudapp/identity'
10
11
  require 'cloudapp/drop_service'
11
- require 'ostruct'
12
12
 
13
13
  Main do
14
14
  def identity
15
- OpenStruct.new email: config[:email], password: config[:password]
15
+ CloudApp::Identity.from_config config
16
16
  end
17
17
 
18
18
  def service
@@ -23,26 +23,39 @@ Main do
23
23
 
24
24
  config email: 'arthur@dent.com', password: 'towel'
25
25
 
26
- mode :new do
26
+ def run
27
+ puts 'TODO: show help here'
28
+ end
27
29
 
28
- # Bookmark a link: `cloudapp new bookmark http://getcloudapp.com`
29
- mode :bookmark do
30
- argument('url') { cast :uri }
30
+ # Bookmark a link: `cloudapp bookmark http://getcloudapp.com`
31
+ mode :bookmark do
32
+ argument('url') { cast :uri }
31
33
 
32
- def run
33
- response = service.create url: params[:url].value
34
- puts response.fetch 'url'
35
- end
34
+ def url
35
+ params[:url].value
36
36
  end
37
37
 
38
- # Share a file: `cloudapp new file screenshot.png`
39
- mode :file do
40
- argument('file') { cast :pathname }
38
+ def run
39
+ Formatador.display "Bookmarking #{ url }..."
41
40
 
42
- def run
43
- response = service.create path: params[:file].value
44
- puts response.fetch 'url'
45
- end
41
+ response = service.create url: url
42
+ Formatador.display_line response.fetch 'url'
43
+ end
44
+ end
45
+
46
+ # Upload a file: `cloudapp upload screenshot.png`
47
+ mode :upload do
48
+ argument('file') { cast :pathname }
49
+
50
+ def file
51
+ params[:file].value
52
+ end
53
+
54
+ def run
55
+ Formatador.display "Uploading #{ file }..."
56
+
57
+ response = service.create path: file
58
+ Formatador.display_line response.fetch 'url'
46
59
  end
47
60
  end
48
61
 
@@ -58,7 +71,7 @@ Main do
58
71
  count = params[:count].value
59
72
  drops = service.drops count
60
73
 
61
- name_width = drops.map {|drop| drop['name'].size }.max
74
+ name_width = drops.map {|drop| drop['name'].to_s.size }.max
62
75
  views_width = [ 5, drops.map {|drop| drop['view_counter'].to_s.size }.max ].max
63
76
  link_width = drops.map {|drop| drop['url'].size }.max
64
77
 
@@ -68,7 +81,7 @@ Main do
68
81
  Formatador.display_line header
69
82
 
70
83
  lines = drops.map do |drop|
71
- [ drop['name'].ljust(name_width),
84
+ [ drop['name'].to_s.ljust(name_width),
72
85
  drop['url'],
73
86
  drop['view_counter'].to_s.center(views_width)
74
87
  ].join ' '
data/cloudapp.gemspec CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
  ## If your rubyforge_project name is different, then edit it and comment out
14
14
  ## the sub! line in the Rakefile
15
15
  s.name = 'cloudapp'
16
- s.version = '0.0.5'
16
+ s.version = '0.0.6'
17
17
  s.date = '2012-02-06'
18
18
  s.rubyforge_project = 'cloudapp'
19
19
 
@@ -72,6 +72,7 @@ Gem::Specification.new do |s|
72
72
  lib/cloudapp.rb
73
73
  lib/cloudapp/digestable_typhoeus.rb
74
74
  lib/cloudapp/drop_service.rb
75
+ lib/cloudapp/identity.rb
75
76
  spec/cassettes/CloudApp_DropService/_create/creates_a_bookmark.yml
76
77
  spec/cassettes/CloudApp_DropService/_create/creates_a_bookmark_with_a_name.yml
77
78
  spec/cassettes/CloudApp_DropService/_create/creates_a_file.yml
@@ -79,6 +80,7 @@ Gem::Specification.new do |s|
79
80
  spec/cassettes/CloudApp_DropService/_drops/returns_a_list_of_drops.yml
80
81
  spec/cassettes/CloudApp_DropService/_drops/returns_a_list_of_trashed_drops.yml
81
82
  spec/cloudapp/drop_service_spec.rb
83
+ spec/cloudapp/identity_spec.rb
82
84
  spec/helper.rb
83
85
  spec/support/files/favicon.ico
84
86
  spec/support/stub_class_or_module.rb
@@ -0,0 +1,14 @@
1
+ module CloudApp
2
+ class Identity
3
+ attr_accessor :email, :password
4
+
5
+ def initialize(email, password)
6
+ @email = email
7
+ @password = password
8
+ end
9
+
10
+ def self.from_config(config)
11
+ new(config.fetch(:email), config.fetch(:password))
12
+ end
13
+ end
14
+ end
data/lib/cloudapp.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module CloudApp
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
@@ -0,0 +1,27 @@
1
+ require 'helper'
2
+
3
+ require 'cloudapp/identity'
4
+
5
+ describe CloudApp::Identity do
6
+ let(:email) { 'arthur@dent.com' }
7
+ let(:password) { 'towel' }
8
+
9
+ describe '.initialize' do
10
+ it 'accepts an email and password' do
11
+ identity = CloudApp::Identity.new email, password
12
+
13
+ identity.email .should eq(email)
14
+ identity.password.should eq(password)
15
+ end
16
+ end
17
+
18
+ describe '.from_config' do
19
+ let(:config) {{ email: email, password: password }}
20
+ subject { CloudApp::Identity.from_config config }
21
+
22
+ it 'returns an identity' do
23
+ subject.email .should eq(email)
24
+ subject.password.should eq(password)
25
+ end
26
+ end
27
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudapp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-02-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: addressable
16
- requirement: &70177639248760 !ruby/object:Gem::Requirement
16
+ requirement: &70198765957800 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70177639248760
24
+ version_requirements: *70198765957800
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: faraday
27
- requirement: &70177639247420 !ruby/object:Gem::Requirement
27
+ requirement: &70198765956240 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 0.8.0.rc2
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70177639247420
35
+ version_requirements: *70198765956240
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: formatador
38
- requirement: &70177639245920 !ruby/object:Gem::Requirement
38
+ requirement: &70198765954800 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70177639245920
46
+ version_requirements: *70198765954800
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: leadlight
49
- requirement: &70177639244200 !ruby/object:Gem::Requirement
49
+ requirement: &70198765953100 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70177639244200
57
+ version_requirements: *70198765953100
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: main
60
- requirement: &70177639243220 !ruby/object:Gem::Requirement
60
+ requirement: &70198765952100 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70177639243220
68
+ version_requirements: *70198765952100
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: typhoeus
71
- requirement: &70177639241940 !ruby/object:Gem::Requirement
71
+ requirement: &70198765950700 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *70177639241940
79
+ version_requirements: *70198765950700
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: rake
82
- requirement: &70177639240440 !ruby/object:Gem::Requirement
82
+ requirement: &70198765949360 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *70177639240440
90
+ version_requirements: *70198765949360
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: rspec
93
- requirement: &70177639239540 !ruby/object:Gem::Requirement
93
+ requirement: &70198765948420 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: '0'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *70177639239540
101
+ version_requirements: *70198765948420
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: vcr
104
- requirement: &70177639237980 !ruby/object:Gem::Requirement
104
+ requirement: &70198765946860 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ~>
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: 2.0.0.rc1
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *70177639237980
112
+ version_requirements: *70198765946860
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: webmock
115
- requirement: &70177639236680 !ruby/object:Gem::Requirement
115
+ requirement: &70198765945220 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ! '>='
@@ -120,7 +120,7 @@ dependencies:
120
120
  version: '0'
121
121
  type: :development
122
122
  prerelease: false
123
- version_requirements: *70177639236680
123
+ version_requirements: *70198765945220
124
124
  description: Experience all the pleasures of sharing with CloudApp now in your terminal.
125
125
  email: larry@marburger.cc
126
126
  executables:
@@ -140,6 +140,7 @@ files:
140
140
  - lib/cloudapp.rb
141
141
  - lib/cloudapp/digestable_typhoeus.rb
142
142
  - lib/cloudapp/drop_service.rb
143
+ - lib/cloudapp/identity.rb
143
144
  - spec/cassettes/CloudApp_DropService/_create/creates_a_bookmark.yml
144
145
  - spec/cassettes/CloudApp_DropService/_create/creates_a_bookmark_with_a_name.yml
145
146
  - spec/cassettes/CloudApp_DropService/_create/creates_a_file.yml
@@ -147,6 +148,7 @@ files:
147
148
  - spec/cassettes/CloudApp_DropService/_drops/returns_a_list_of_drops.yml
148
149
  - spec/cassettes/CloudApp_DropService/_drops/returns_a_list_of_trashed_drops.yml
149
150
  - spec/cloudapp/drop_service_spec.rb
151
+ - spec/cloudapp/identity_spec.rb
150
152
  - spec/helper.rb
151
153
  - spec/support/files/favicon.ico
152
154
  - spec/support/stub_class_or_module.rb