backpack_journal 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.bundle/config +2 -0
- data/.gitignore +3 -0
- data/CHANGELOG.rdoc +17 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +27 -0
- data/Manifest.txt +6 -0
- data/README.rdoc +57 -0
- data/Rakefile +4 -0
- data/backpack_journal.gemspec +26 -0
- data/bin/backpack_journal +51 -0
- data/lib/backpack_journal.rb +3 -0
- metadata +127 -0
data/.bundle/config
ADDED
data/.gitignore
ADDED
data/CHANGELOG.rdoc
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
=== 1.1.0 / 2009-06-22
|
2
|
+
|
3
|
+
* Publish as a Gem.
|
4
|
+
* Standardize directory structure.
|
5
|
+
* Switch to new Hoe.
|
6
|
+
|
7
|
+
=== 1.0.2 / 2008-05-23
|
8
|
+
|
9
|
+
* Unbreak RDoc generation.
|
10
|
+
|
11
|
+
=== 1.0.1 / 2008-05-23
|
12
|
+
|
13
|
+
* Dependency, gem, and README fixes.
|
14
|
+
|
15
|
+
=== 1.0.0 / 2008-05-22
|
16
|
+
|
17
|
+
* Birthday!
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
backpack-journal (1.1.0)
|
5
|
+
rest-client (~> 1.6.1)
|
6
|
+
thor (~> 0.14.6)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: http://rubygems.org/
|
10
|
+
specs:
|
11
|
+
mime-types (1.16)
|
12
|
+
rake (0.8.7)
|
13
|
+
rest-client (1.6.1)
|
14
|
+
mime-types (>= 1.16)
|
15
|
+
thor (0.14.6)
|
16
|
+
|
17
|
+
PLATFORMS
|
18
|
+
ruby
|
19
|
+
|
20
|
+
DEPENDENCIES
|
21
|
+
backpack-journal!
|
22
|
+
rake (~> 0.8.7)
|
23
|
+
rest-client (~> 1.6.1)
|
24
|
+
thor (~> 0.14.6)
|
25
|
+
|
26
|
+
METADATA
|
27
|
+
version: 1.0.6
|
data/Manifest.txt
ADDED
data/README.rdoc
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
= Backpack Journal
|
2
|
+
|
3
|
+
* https://github.com/railslove/backpack-journal
|
4
|
+
|
5
|
+
== Description
|
6
|
+
|
7
|
+
Make journal and status entries in 37signals' Backpack. This was a
|
8
|
+
lunchtime project, and it's been dormant for a while. I'm not even
|
9
|
+
sure if this code works. If you happen to use this and want to take
|
10
|
+
over as maintainer, drop me a line!
|
11
|
+
|
12
|
+
== Examples
|
13
|
+
|
14
|
+
# user-id is your NUMERIC user ID. Check your URL, e.g.,
|
15
|
+
# http://something.backpackit.com/users/31415926/edit
|
16
|
+
|
17
|
+
## The subdomain should include the http(s)
|
18
|
+
# e.g.
|
19
|
+
# backpack_journal setup https://awesomeinc 123 123
|
20
|
+
# or
|
21
|
+
# backpack_journal setup http://awesomeinc 123 123
|
22
|
+
##
|
23
|
+
|
24
|
+
$ backpack_journal setup <subdomain> <user-id> <api-token>
|
25
|
+
$ backpack_journal entry "Got my daily dose of awesome."
|
26
|
+
|
27
|
+
I recommend adding an alias in ~/.profile
|
28
|
+
|
29
|
+
alias j="backpack_journal"
|
30
|
+
alias je="backpack_journal entry"
|
31
|
+
|
32
|
+
== Installation
|
33
|
+
|
34
|
+
$ gem install backpack_journal
|
35
|
+
|
36
|
+
== License
|
37
|
+
|
38
|
+
Copyright 2008 John Barnette <jbarnette@rubyforge.org>
|
39
|
+
|
40
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
41
|
+
a copy of this software and associated documentation files (the
|
42
|
+
'Software'), to deal in the Software without restriction, including
|
43
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
44
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
45
|
+
permit persons to whom the Software is furnished to do so, subject to
|
46
|
+
the following conditions:
|
47
|
+
|
48
|
+
The above copyright notice and this permission notice shall be
|
49
|
+
included in all copies or substantial portions of the Software.
|
50
|
+
|
51
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
52
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
53
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
54
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
55
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
56
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
57
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "backpack_journal"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "backpack_journal"
|
7
|
+
s.version = BackpackJournal::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["John Barnette", "Red Davis"]
|
10
|
+
s.email = ["jbarnette@rubyforge.org", "red@railslove.com"]
|
11
|
+
s.homepage = "https://github.com/railslove/backpack-journal"
|
12
|
+
s.summary = %q{CLI tool for Backpack journal}
|
13
|
+
s.description = %q{CLI tool for Backpack journal}
|
14
|
+
|
15
|
+
s.rubyforge_project = "backpack_journal"
|
16
|
+
|
17
|
+
s.add_dependency "thor", "~> 0.14.6"
|
18
|
+
s.add_dependency "rest-client", "~> 1.6.1"
|
19
|
+
|
20
|
+
s.add_development_dependency "rake", "~> 0.8.7"
|
21
|
+
|
22
|
+
s.files = `git ls-files`.split("\n")
|
23
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
24
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
25
|
+
s.require_paths = ["lib"]
|
26
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "rubygems"
|
4
|
+
require "pathname"
|
5
|
+
require "thor"
|
6
|
+
|
7
|
+
require "net/http"
|
8
|
+
require "rest_client"
|
9
|
+
require "uri"
|
10
|
+
|
11
|
+
module BackpackJournal
|
12
|
+
class CLI < Thor
|
13
|
+
IDENTITY = Pathname.new(File.expand_path("~/.backpack-journal"))
|
14
|
+
|
15
|
+
desc "setup USER_ID TOKEN", "set up your Backpack identity"
|
16
|
+
def setup(subdomain, user_id, token)
|
17
|
+
save_identity(subdomain, user_id, token)
|
18
|
+
end
|
19
|
+
|
20
|
+
desc "entry MESSAGE", "add a journal entry"
|
21
|
+
def entry(message)
|
22
|
+
subdomain, user_id, token = load_identity
|
23
|
+
|
24
|
+
url = "#{subdomain}.backpackit.com/users/#{user_id}/journal_entries.xml"
|
25
|
+
|
26
|
+
body =<<-END
|
27
|
+
<request>
|
28
|
+
<token>#{token}</token>
|
29
|
+
<journal-entry>
|
30
|
+
<body>#{message}</body>
|
31
|
+
</journal-entry>
|
32
|
+
</request>
|
33
|
+
END
|
34
|
+
|
35
|
+
RestClient.post url, body, :content_type => :xml
|
36
|
+
end
|
37
|
+
|
38
|
+
private
|
39
|
+
|
40
|
+
def save_identity(subdomain, user_id, token)
|
41
|
+
IDENTITY.open("w") { |i| i.write("#{subdomain},#{user_id},#{token}") }
|
42
|
+
end
|
43
|
+
|
44
|
+
def load_identity
|
45
|
+
abort("No identity: run backpack-journal setup") unless IDENTITY.exist?
|
46
|
+
IDENTITY.read.split(",")
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
BackpackJournal::CLI.start
|
metadata
ADDED
@@ -0,0 +1,127 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: backpack_journal
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 0.0.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- John Barnette
|
14
|
+
- Red Davis
|
15
|
+
autorequire:
|
16
|
+
bindir: bin
|
17
|
+
cert_chain: []
|
18
|
+
|
19
|
+
date: 2010-11-22 00:00:00 +00:00
|
20
|
+
default_executable:
|
21
|
+
dependencies:
|
22
|
+
- !ruby/object:Gem::Dependency
|
23
|
+
name: thor
|
24
|
+
prerelease: false
|
25
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ~>
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
hash: 43
|
31
|
+
segments:
|
32
|
+
- 0
|
33
|
+
- 14
|
34
|
+
- 6
|
35
|
+
version: 0.14.6
|
36
|
+
type: :runtime
|
37
|
+
version_requirements: *id001
|
38
|
+
- !ruby/object:Gem::Dependency
|
39
|
+
name: rest-client
|
40
|
+
prerelease: false
|
41
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ~>
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
hash: 13
|
47
|
+
segments:
|
48
|
+
- 1
|
49
|
+
- 6
|
50
|
+
- 1
|
51
|
+
version: 1.6.1
|
52
|
+
type: :runtime
|
53
|
+
version_requirements: *id002
|
54
|
+
- !ruby/object:Gem::Dependency
|
55
|
+
name: rake
|
56
|
+
prerelease: false
|
57
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ~>
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
hash: 49
|
63
|
+
segments:
|
64
|
+
- 0
|
65
|
+
- 8
|
66
|
+
- 7
|
67
|
+
version: 0.8.7
|
68
|
+
type: :development
|
69
|
+
version_requirements: *id003
|
70
|
+
description: CLI tool for Backpack journal
|
71
|
+
email:
|
72
|
+
- jbarnette@rubyforge.org
|
73
|
+
- red@railslove.com
|
74
|
+
executables:
|
75
|
+
- backpack_journal
|
76
|
+
extensions: []
|
77
|
+
|
78
|
+
extra_rdoc_files: []
|
79
|
+
|
80
|
+
files:
|
81
|
+
- .bundle/config
|
82
|
+
- .gitignore
|
83
|
+
- CHANGELOG.rdoc
|
84
|
+
- Gemfile
|
85
|
+
- Gemfile.lock
|
86
|
+
- Manifest.txt
|
87
|
+
- README.rdoc
|
88
|
+
- Rakefile
|
89
|
+
- backpack_journal.gemspec
|
90
|
+
- bin/backpack_journal
|
91
|
+
- lib/backpack_journal.rb
|
92
|
+
has_rdoc: true
|
93
|
+
homepage: https://github.com/railslove/backpack-journal
|
94
|
+
licenses: []
|
95
|
+
|
96
|
+
post_install_message:
|
97
|
+
rdoc_options: []
|
98
|
+
|
99
|
+
require_paths:
|
100
|
+
- lib
|
101
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
102
|
+
none: false
|
103
|
+
requirements:
|
104
|
+
- - ">="
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
hash: 3
|
107
|
+
segments:
|
108
|
+
- 0
|
109
|
+
version: "0"
|
110
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
111
|
+
none: false
|
112
|
+
requirements:
|
113
|
+
- - ">="
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
hash: 3
|
116
|
+
segments:
|
117
|
+
- 0
|
118
|
+
version: "0"
|
119
|
+
requirements: []
|
120
|
+
|
121
|
+
rubyforge_project: backpack_journal
|
122
|
+
rubygems_version: 1.3.7
|
123
|
+
signing_key:
|
124
|
+
specification_version: 3
|
125
|
+
summary: CLI tool for Backpack journal
|
126
|
+
test_files: []
|
127
|
+
|