Skip to content

Commit

Permalink
Version 0.1.1
Browse files Browse the repository at this point in the history
* No more setup needed
* The cache storage is not managed by the gem
* The ShellCommand is named `thimblr`
* The messages are supported without `address` key
  • Loading branch information
fguillen committed Feb 12, 2011
1 parent 7f746c0 commit 20d8bc5
Show file tree
Hide file tree
Showing 11 changed files with 205 additions and 296 deletions.
3 changes: 2 additions & 1 deletion Manifest
Expand Up @@ -3,11 +3,12 @@ Gemfile.lock
Manifest
README.md
Rakefile
bin/thimbl
bin/thimblr
lib/thimbl.rb
lib/thimbl/base.rb
lib/thimbl/command.rb
lib/thimbl/finger.rb
lib/thimbl/utils.rb
test/fixtures/cache.json
test/fixtures/finger_dk_telekommunisten_org.txt
test/fixtures/finger_dk_telekommunisten_org_two_break_lines.txt
Expand Down
43 changes: 16 additions & 27 deletions README.md
Expand Up @@ -6,7 +6,6 @@ I have follow the style of the [Thimbl Python client](https://github.com/blippy/

## Commands

* setup
* follow
* fetch
* post
Expand All @@ -30,44 +29,34 @@ This version is in development, not ready for any production environment.
require 'rubygems'
require 'thimbl'
thimbl =
Thimbl::Base.new(
'plan_path' => '/tmp/plan',
'cache_path' => '/tmp/thimbl_cache',
'user' => 'fguillen@thimblserver.com',
'password' => 'my_thimblserver_password'
Thimbl::Base.new(
'bio' => 'my bio',
'website' => 'my website',
'mobile' => 'my mobile',
'email' => 'my email',
'address' => 'me@thimbl.net',
'name' => 'my name'
)
thimbl.setup(
'bio' => 'my bio',
'website' => 'my website',
'mobile' => 'my mobile',
'email' => 'my email',
'address' => 'my address',
'name' => 'my name'
)
thimbl.follow 'dk', 'dk@telekommunisten.org'
thimbl.fetch
thimbl.print
thimbl.post 'My first post'
thimbl.push
thimbl.push 'password'

## Shell Command

The gem comes with a *shell command*, you can use it like this:

thimbl setup ~/thimbl_plan ~/thimbl_cache 'user@thimblserver.com' 'thimblpass'
thimbl follow 'dk' 'dk@telekommunisten.org'
thimbl fetch
thimbl print
thimbl post "My first message :)"
thimbl push
thimblr setup 'user@thimblrserver.com'
thimblr follow 'dk' 'dk@telekommunisten.org'
thimblr fetch
thimblr print
thimblr post "My first message :)"
thimblr push <password>

## TODO

* Shell script /bin/thimbl
* Thinking that the *plan_path* is not needed.
* Not save thimbl password, request for it in any *thimbl.push*
* Support *simbolize* hash keys
* In the Thimbl::Command.setup ask for the rest of the configuration options *bio*, *mobile*, ...
* thimbl.unfollow
* ERROR: If finger respond empty Plan
* ERROR: the message format is without *address* key.
* ERROR: If finger respond empty Plan
4 changes: 2 additions & 2 deletions Rakefile
Expand Up @@ -2,12 +2,12 @@ require 'rubygems'
require 'rake'
require 'echoe'

Echoe.new('thimbl', '0.0.3') do |p|
Echoe.new('thimbl', '0.1.1') do |p|
p.description = "Small client for the distributed microbloging protocol: [thimbl](http://www.thimbl.net/)"
p.url = "http://github.com/fguillen/ThimblClient"
p.author = "Fernando Guillen"
p.email = "fguillen.mail@gmail.com"
p.ignore_pattern = ['etc/*']
p.development_dependencies = ['mocha', 'ruby-debug', 'delorean']
p.runtime_dependencies = ['json', 'net-scp']
p.runtime_dependencies = ['json', 'net-scp', 'tempfile']
end
16 changes: 9 additions & 7 deletions bin/thimbl → bin/thimblr
@@ -1,12 +1,12 @@
#!/usr/bin/env ruby

# Use:
# thimbl setup ~/thimbl_plan ~/thimbl_cache 'user@thimblserver.com' 'thimblpass'
# thimbl follow 'dk' 'dk@telekommunisten.org'
# thimbl fetch
# thimbl print
# thimbl post "My first message :)"
# thimbl push
# thimblr setup 'user@thimblrserver.com'
# thimblr follow 'dk' 'dk@telekommunisten.org'
# thimblr fetch
# thimblr print
# thimblr post "My first message :)"
# thimblr push

begin
require 'thimbl'
Expand All @@ -26,11 +26,13 @@ begin
when 'print'; puts Thimbl::Command.print
when 'fetch'; Thimbl::Command.fetch; puts "fecth completed"
when 'post'; Thimbl::Command.post ARGV[1]; puts "post completed"
when 'push'; Thimbl::Command.push; puts "push completed"
when 'push'; Thimbl::Command.push ARGV[1]; puts "push completed"
when 'follow'; Thimbl::Command.follow( ARGV[1], ARGV[2] ); puts "follow completed"
else
puts "command not valid '#{ARGV[0]}'"
exit 1
end
rescue ArgumentError => e
puts e.message
exit 1
end
2 changes: 2 additions & 0 deletions lib/thimbl.rb
Expand Up @@ -2,6 +2,8 @@
require 'json'
require 'net/scp'
require 'fileutils'
require 'tempfile'
require "#{File.dirname(__FILE__)}/thimbl/base"
require "#{File.dirname(__FILE__)}/thimbl/command"
require "#{File.dirname(__FILE__)}/thimbl/finger"
require "#{File.dirname(__FILE__)}/thimbl/utils"

0 comments on commit 20d8bc5

Please sign in to comment.