surely 0.2 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -8,11 +8,24 @@ Surely is a daemon that watches your screenshots directory and upload new files
8
8
  # Install the gem
9
9
  $ gem install surely
10
10
 
11
- # Configure it (this sucks but that’ll do for now)
11
+ # Configure it (environment variables sucks but that’ll do for now)
12
12
  # Create an imgur application here: https://api.imgur.com/oauth2/addclient
13
13
  export IMGUR_CLIENT_ID=…
14
14
  export IMGUR_CLIENT_SECRET=…
15
15
 
16
- # Start the daemon (OS X screenshots directory by default)
16
+ # Start it
17
+ # The first time you run it, it will open a browser window and ask you to
18
+ # enter the OAuth credentials that you will obtain after allowing your imgur app
19
+ $ surely start
20
+
21
+ # After that, you can kill it (^C) and start it as a real daemon
17
22
  $ surely start -d
18
23
  ```
24
+
25
+ ## Taking a screenshot
26
+
27
+ When you take a screenshot, Surely does three things:
28
+
29
+ 1. Upload it to your imgur account
30
+ 2. Copy the uploaded file URL into the clipboard
31
+ 3. Say *Uploaded!* out loud (using the `say` utility)
data/lib/surely/daemon.rb CHANGED
@@ -5,14 +5,17 @@ module Surely
5
5
  end
6
6
 
7
7
  def start
8
- directory = @env['SURELY_DIRECTORY'] || `defaults read com.apple.screencapture location`.chomp
8
+ directory = @env['SURELY_DIRECTORY']
9
+ directory ||= `defaults read com.apple.screencapture location 2> /dev/null`.chomp
10
+ directory = "#{@env['HOME']}/Desktop" if directory.empty?
11
+
9
12
  @uploader = Uploader.new(@env, directory)
10
13
  @uploader.authorize!
11
14
 
12
15
  Raad::Logger.info "Listening to changes on #{directory}..."
13
16
 
14
17
  listener = Listen.to(directory)
15
- listener.filter(/\.(png|jpg|jpeg|gif)$/)
18
+ listener.filter(/\.(png|jpg|jpeg|gif)$/i)
16
19
  listener.change(&@uploader.callback)
17
20
  listener.start
18
21
 
@@ -1,3 +1,3 @@
1
1
  module Surely
2
- VERSION = '0.2'
2
+ VERSION = '0.2.1'
3
3
  end
metadata CHANGED
@@ -1,18 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: surely
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.2'
4
+ version: 0.2.1
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Rémi Prévost
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-05-03 00:00:00.000000000 Z
12
+ date: 2013-05-11 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: faraday
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
19
  - - ~>
18
20
  - !ruby/object:Gem::Version
@@ -20,6 +22,7 @@ dependencies:
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
27
  - - ~>
25
28
  - !ruby/object:Gem::Version
@@ -27,6 +30,7 @@ dependencies:
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: listen
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
35
  - - ~>
32
36
  - !ruby/object:Gem::Version
@@ -34,6 +38,7 @@ dependencies:
34
38
  type: :runtime
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
43
  - - ~>
39
44
  - !ruby/object:Gem::Version
@@ -41,6 +46,7 @@ dependencies:
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: multi_json
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
51
  - - ~>
46
52
  - !ruby/object:Gem::Version
@@ -48,6 +54,7 @@ dependencies:
48
54
  type: :runtime
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
59
  - - ~>
53
60
  - !ruby/object:Gem::Version
@@ -55,6 +62,7 @@ dependencies:
55
62
  - !ruby/object:Gem::Dependency
56
63
  name: yajl-ruby
57
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
58
66
  requirements:
59
67
  - - ~>
60
68
  - !ruby/object:Gem::Version
@@ -62,6 +70,7 @@ dependencies:
62
70
  type: :runtime
63
71
  prerelease: false
64
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
65
74
  requirements:
66
75
  - - ~>
67
76
  - !ruby/object:Gem::Version
@@ -69,6 +78,7 @@ dependencies:
69
78
  - !ruby/object:Gem::Dependency
70
79
  name: raad
71
80
  requirement: !ruby/object:Gem::Requirement
81
+ none: false
72
82
  requirements:
73
83
  - - ~>
74
84
  - !ruby/object:Gem::Version
@@ -76,6 +86,7 @@ dependencies:
76
86
  type: :runtime
77
87
  prerelease: false
78
88
  version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
79
90
  requirements:
80
91
  - - ~>
81
92
  - !ruby/object:Gem::Version
@@ -83,6 +94,7 @@ dependencies:
83
94
  - !ruby/object:Gem::Dependency
84
95
  name: rake
85
96
  requirement: !ruby/object:Gem::Requirement
97
+ none: false
86
98
  requirements:
87
99
  - - ~>
88
100
  - !ruby/object:Gem::Version
@@ -90,6 +102,7 @@ dependencies:
90
102
  type: :development
91
103
  prerelease: false
92
104
  version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
93
106
  requirements:
94
107
  - - ~>
95
108
  - !ruby/object:Gem::Version
@@ -117,26 +130,33 @@ files:
117
130
  homepage: http://github.com/remiprev/surely
118
131
  licenses:
119
132
  - MIT
120
- metadata: {}
121
133
  post_install_message:
122
134
  rdoc_options: []
123
135
  require_paths:
124
136
  - lib
125
137
  required_ruby_version: !ruby/object:Gem::Requirement
138
+ none: false
126
139
  requirements:
127
140
  - - ! '>='
128
141
  - !ruby/object:Gem::Version
129
142
  version: '0'
143
+ segments:
144
+ - 0
145
+ hash: -13490925257366599
130
146
  required_rubygems_version: !ruby/object:Gem::Requirement
147
+ none: false
131
148
  requirements:
132
149
  - - ! '>='
133
150
  - !ruby/object:Gem::Version
134
151
  version: '0'
152
+ segments:
153
+ - 0
154
+ hash: -13490925257366599
135
155
  requirements: []
136
156
  rubyforge_project:
137
- rubygems_version: 2.0.2
157
+ rubygems_version: 1.8.23
138
158
  signing_key:
139
- specification_version: 4
159
+ specification_version: 3
140
160
  summary: Surely watches your screenshots directory and upload new files to your imgur
141
161
  account.
142
162
  test_files: []
checksums.yaml DELETED
@@ -1,15 +0,0 @@
1
- ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZjEwNmU3MmQ5NjBkNDFiMWYxZjg1NGNjZjYwZDE2MTUxZDY3OWVmMA==
5
- data.tar.gz: !binary |-
6
- NGZlZWZkM2JhMzlkMjU3N2NmNjNmZDYyNDRkODk0MjRjNmI4YWE3Yg==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- ZTQyYTM0M2U2M2NiMWMyZGZiNjRiMzlmZjYyNTIwMmRlNzRmY2EzNmQ4YWZm
10
- NjlhYjI2ZmZiYjQxMmZlNTUwMmE2YWMyY2I4MDMyYTIzZjlhZjBmNTQ0ODQz
11
- MTIxZjFiNTdkMWZkMjBiYzViNTQxMWQzMGMyNDYyYTYwYjMwNjE=
12
- data.tar.gz: !binary |-
13
- NjRkNzAxZDQxOGM2NmZjZjk4YTc5NzBhOGRkYmFkYWYzMmE1ZTYzMjE1NmZj
14
- ZmIxNGU1YjQ3MWIxMzA2ZGNlMjZjZDdhYzU3NTBiMGRjZjFhNDU2MWFkYzFl
15
- OWEyNThjYTlkNGVmNTliZGJiNzg2YmYwODNiOWUyZGY0MmVlZWY=