jnunemaker-twitter 0.3.8 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/config/hoe.rb DELETED
@@ -1,74 +0,0 @@
1
- require 'twitter/version'
2
-
3
- AUTHOR = "John Nunemaker" # can also be an array of Authors
4
- EMAIL = "nunemaker@gmail.com"
5
- DESCRIPTION = "a command line interface for twitter, also a library which wraps the twitter api"
6
- GEM_NAME = "twitter" # what ppl will type to install your gem
7
- RUBYFORGE_PROJECT = "twitter" # The unix name for your project
8
- HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
9
- RELEASE_TYPES = %w( gem ) # can use: gem, tar, zip
10
- DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
11
-
12
- @config_file = "~/.rubyforge/user-config.yml"
13
- @config = nil
14
- RUBYFORGE_USERNAME = "unknown"
15
- def rubyforge_username
16
- unless @config
17
- begin
18
- @config = YAML.load(File.read(File.expand_path(@config_file)))
19
- rescue
20
- puts <<-EOS
21
- ERROR: No rubyforge config file found: #{@config_file}
22
- Run 'rubyforge setup' to prepare your env for access to Rubyforge
23
- - See http://newgem.rubyforge.org/rubyforge.html for more details
24
- EOS
25
- exit
26
- end
27
- end
28
- RUBYFORGE_USERNAME.replace @config["username"]
29
- end
30
-
31
-
32
- REV = nil
33
- # UNCOMMENT IF REQUIRED:
34
- # REV = `svn info`.each {|line| if line =~ /^Revision:/ then k,v = line.split(': '); break v.chomp; else next; end} rescue nil
35
- VERS = Twitter::VERSION::STRING + (REV ? ".#{REV}" : "")
36
- RDOC_OPTS = ['--quiet', '--title', 'twitter documentation',
37
- "--opname", "index.html",
38
- "--line-numbers",
39
- "--main", "README",
40
- "--inline-source"]
41
-
42
- class Hoe
43
- def extra_deps
44
- @extra_deps.reject! { |x| Array(x).first == 'hoe' }
45
- @extra_deps
46
- end
47
- end
48
-
49
- # Generate all the Rake tasks
50
- # Run 'rake -T' to see list of generated tasks (from gem root directory)
51
- hoe = Hoe.new(GEM_NAME, VERS) do |p|
52
- p.author = AUTHOR
53
- p.description = DESCRIPTION
54
- p.email = EMAIL
55
- p.summary = DESCRIPTION
56
- p.url = HOMEPATH
57
- p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
58
- p.test_globs = ["test/**/test_*.rb"]
59
- p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store'] #An array of file patterns to delete on clean.
60
-
61
- # == Optional
62
- p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
63
- #p.extra_deps = [] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ]
64
- p.extra_deps = [['hpricot', '>= 0.6'], ['activesupport', '>= 2.1'],
65
- ['main', '>= 2.8.2'], ['highline', '>= 1.4.0'],
66
- ['activerecord', '>= 2.1'], ['httparty', '>= 0.1.0']]
67
- #p.spec_extras = {} # A hash of extra values to set in the gemspec.
68
-
69
- end
70
-
71
- CHANGES = hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
72
- PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
73
- hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
74
- hoe.rsync_args = '-av --delete --ignore-errors'
@@ -1,17 +0,0 @@
1
- require 'fileutils'
2
- include FileUtils
3
-
4
- require 'rubygems'
5
- %w[rake hoe newgem rubigen].each do |req_gem|
6
- begin
7
- require req_gem
8
- rescue LoadError
9
- puts "This Rakefile requires the '#{req_gem}' RubyGem."
10
- puts "Installation: gem install #{req_gem} -y"
11
- exit
12
- end
13
- end
14
-
15
- $:.unshift(File.join(File.dirname(__FILE__), %w[.. lib]))
16
-
17
- require 'twitter'
data/script/destroy DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_ROOT = File.join(File.dirname(__FILE__), '..')
3
-
4
- begin
5
- require 'rubigen'
6
- rescue LoadError
7
- require 'rubygems'
8
- require 'rubigen'
9
- end
10
- require 'rubigen/scripts/destroy'
11
-
12
- ARGV.shift if ['--help', '-h'].include?(ARGV[0])
13
- RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
14
- RubiGen::Scripts::Destroy.new.run(ARGV)
data/script/generate DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_ROOT = File.join(File.dirname(__FILE__), '..')
3
-
4
- begin
5
- require 'rubigen'
6
- rescue LoadError
7
- require 'rubygems'
8
- require 'rubigen'
9
- end
10
- require 'rubigen/scripts/generate'
11
-
12
- ARGV.shift if ['--help', '-h'].include?(ARGV[0])
13
- RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
14
- RubiGen::Scripts::Generate.new.run(ARGV)
data/script/txt2html DELETED
@@ -1,74 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'rubygems'
4
- begin
5
- require 'newgem'
6
- rescue LoadError
7
- puts "\n\nGenerating the website requires the newgem RubyGem"
8
- puts "Install: gem install newgem\n\n"
9
- exit(1)
10
- end
11
- require 'redcloth'
12
- require 'syntax/convertors/html'
13
- require 'erb'
14
- require File.dirname(__FILE__) + '/../lib/twitter/version.rb'
15
-
16
- version = Twitter.git::VERSION::STRING
17
- download = 'http://rubyforge.org/projects/twitter'
18
-
19
- class Fixnum
20
- def ordinal
21
- # teens
22
- return 'th' if (10..19).include?(self % 100)
23
- # others
24
- case self % 10
25
- when 1: return 'st'
26
- when 2: return 'nd'
27
- when 3: return 'rd'
28
- else return 'th'
29
- end
30
- end
31
- end
32
-
33
- class Time
34
- def pretty
35
- return "#{mday}#{mday.ordinal} #{strftime('%B')} #{year}"
36
- end
37
- end
38
-
39
- def convert_syntax(syntax, source)
40
- return Syntax::Convertors::HTML.for_syntax(syntax).convert(source).gsub(%r!^<pre>|</pre>$!,'')
41
- end
42
-
43
- if ARGV.length >= 1
44
- src, template = ARGV
45
- template ||= File.join(File.dirname(__FILE__), '/../website/template.rhtml')
46
-
47
- else
48
- puts("Usage: #{File.split($0).last} source.txt [template.rhtml] > output.html")
49
- exit!
50
- end
51
-
52
- template = ERB.new(File.open(template).read)
53
-
54
- title = nil
55
- body = nil
56
- File.open(src) do |fsrc|
57
- title_text = fsrc.readline
58
- body_text = fsrc.read
59
- syntax_items = []
60
- body_text.gsub!(%r!<(pre|code)[^>]*?syntax=['"]([^'"]+)[^>]*>(.*?)</\1>!m){
61
- ident = syntax_items.length
62
- element, syntax, source = $1, $2, $3
63
- syntax_items << "<#{element} class='syntax'>#{convert_syntax(syntax, source)}</#{element}>"
64
- "syntax-temp-#{ident}"
65
- }
66
- title = RedCloth.new(title_text).to_html.gsub(%r!<.*?>!,'').strip
67
- body = RedCloth.new(body_text).to_html
68
- body.gsub!(%r!(?:<pre><code>)?syntax-temp-(\d+)(?:</code></pre>)?!){ syntax_items[$1.to_i] }
69
- end
70
- stat = File.stat(src)
71
- created = stat.ctime
72
- modified = stat.mtime
73
-
74
- $stdout << template.result(binding)