Skip to content
Browse files

coding

  • Loading branch information...
1 parent 902ef9e commit badcd5106ccf9a85d1457f6c6179b4b6edd9b1f1 @ohac committed Apr 13, 2011
Showing with 38 additions and 1 deletion.
  1. +1 −1 README.md
  2. +2 −0 Rakefile
  3. +33 −0 bin/torrentgem
  4. +2 −0 lib/torrentgem.rb
View
2 README.md
@@ -13,7 +13,7 @@ Use
Preparing
- $ torrentgem init {Your-Twitter-ID}
+ $ torrentgem -i {Your-Twitter-ID}
$ cd
$ ls
TorrentGem.yourid
View
2 Rakefile
@@ -23,6 +23,8 @@ Jeweler::Tasks.new do |gem|
# and development dependencies are only needed for development (ie running rake tasks, tests, etc)
# gem.add_runtime_dependency 'jabber4r', '> 0.1'
# gem.add_development_dependency 'rspec', '> 1.2.3'
+ gem.add_runtime_dependency 'choice', '>= 0.1.4'
+ gem.add_runtime_dependency 'bencode', '>= 0.6.0'
end
Jeweler::RubygemsDotOrgTasks.new
View
33 bin/torrentgem
@@ -0,0 +1,33 @@
+#!/usr/bin/env ruby
+# -*- coding: utf-8 -*-
+self_file =
+ if File.symlink?(__FILE__)
+ require 'pathname'
+ Pathname.new(__FILE__).realpath
+ else
+ __FILE__
+ end
+$:.unshift(File.dirname(self_file) + "/../lib")
+
+require 'torrentgem'
+require 'choice'
+require 'fileutils'
+
+Choice.options do
+ option :init do
+ short '-i'
+ end
+end
+
+HOME = ENV['HOME']
+c = Choice.choices
+if c.init
+ screenname = c.init
+ raise 'no screenname' if screenname == true
+ dir = "#{HOME}/TorrentGem.#{screenname}"
+ FileUtils.mkdir_p dir
+ puts "Hello #{screenname}."
+ puts "Your TorrentGem Folder is: #{dir}"
+else
+ p :else
+end
View
2 lib/torrentgem.rb
@@ -0,0 +1,2 @@
+require 'rubygems'
+require 'bencode'

0 comments on commit badcd51

Please sign in to comment.
Something went wrong with that request. Please try again.