tumblr-rb 2.0.0.alpha → 2.0.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/Gemfile.lock +1 -1
- data/README.md +10 -8
- data/Rakefile +64 -0
- data/lib/tumblr/version.rb +1 -1
- data/share/tumblr-rb.rb +49 -0
- metadata +9 -5
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -2,21 +2,21 @@
|
|
2
2
|
|
3
3
|
Command line interface and Ruby client for the [Tumblr API](http://www.tumblr.com/docs/en/api/v2)
|
4
4
|
|
5
|
-
It's
|
5
|
+
It's been rewritten from the ground up to support v2 of the api.
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
Like the previous version, the current version reads files with a special front-matter block, like [Jekyll](http://tom.preston-werner.com/jekyll/). In addition, this new version offers the ability to post photos, videos, and audio.
|
7
|
+
Like the v1, the current version reads files with a special front-matter block, like [Jekyll](http://tom.preston-werner.com/jekyll/). In addition, this new version offers the ability to post photos, videos, and audio.
|
10
8
|
|
11
9
|
Unlike the previous version, this new command line utility uses OAuth to authenticate and authorize the user.
|
12
10
|
|
13
|
-
##
|
11
|
+
## Installation
|
14
12
|
|
15
|
-
|
13
|
+
If you're on a Mac using [Homebrew](http://mxcl.github.com/homebrew/) and are just interested in the cli:
|
16
14
|
|
17
|
-
|
15
|
+
brew install https://raw.github.com/mwunsch/tumblr/master/share/tumblr-rb.rb
|
18
16
|
|
19
|
-
|
17
|
+
Or with gem:
|
18
|
+
|
19
|
+
gem install tumblr-rb
|
20
20
|
|
21
21
|
Alternatively, you can clone the repo, and run `rake install` -- this will build the gem, place it in the `pkg` directory, and install the gem to your system. You should then be able to `require 'tumblr'` and/or run `tumblr` from the command line.
|
22
22
|
|
@@ -57,6 +57,8 @@ Understood YAML parameters are taken from the Tumblr API: http://www.tumblr.com/
|
|
57
57
|
|
58
58
|
tweet Manages the autotweet (if enabled) for this post
|
59
59
|
|
60
|
+
See [tumblr(5)](http://mwunsch.github.com/tumblr/tumblr.5.html) for more info.
|
61
|
+
|
60
62
|
## Copyright
|
61
63
|
|
62
64
|
The Tumblr gem is Copyright (c) 2010 - 2012 Mark Wunsch and is licensed under the [MIT License](http://creativecommons.org/licenses/MIT/).
|
data/Rakefile
CHANGED
@@ -17,3 +17,67 @@ desc "Show the manual"
|
|
17
17
|
task :man => :build_man do
|
18
18
|
exec "man man/tumblr.1"
|
19
19
|
end
|
20
|
+
|
21
|
+
desc "Build a homebrew formula"
|
22
|
+
file "brew" do
|
23
|
+
# Thanks to Josh Peek for making brew-gem
|
24
|
+
# https://github.com/josh/brew-gem
|
25
|
+
require 'tumblr/version'
|
26
|
+
version = Tumblr::VERSION
|
27
|
+
gem_name = "tumblr-rb"
|
28
|
+
template = ERB.new(File.read(__FILE__).split(/^__END__$/, 2)[1].strip)
|
29
|
+
filename = File.join File.dirname(__FILE__), "share", "tumblr-rb.rb"
|
30
|
+
File.open(filename, "w") {|f| f.puts template.result(binding) }
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
__END__
|
35
|
+
# This is a generated file. Run `rake brew`
|
36
|
+
require 'formula'
|
37
|
+
|
38
|
+
class RubyGemFormula < Formula
|
39
|
+
class NoopDownloadStrategy < AbstractDownloadStrategy
|
40
|
+
def fetch; end
|
41
|
+
def stage; end
|
42
|
+
end
|
43
|
+
|
44
|
+
def download_strategy
|
45
|
+
NoopDownloadStrategy
|
46
|
+
end
|
47
|
+
|
48
|
+
def install
|
49
|
+
# set GEM_HOME and GEM_PATH to make sure we package all the dependent gems
|
50
|
+
# together without accidently picking up other gems on the gem path since
|
51
|
+
# they might not be there if, say, we change to a different rvm gemset
|
52
|
+
ENV['GEM_HOME']="#{prefix}"
|
53
|
+
ENV['GEM_PATH']="#{prefix}"
|
54
|
+
system "gem", "install", "<%= gem_name %>",
|
55
|
+
"--version", "<%= version %>",
|
56
|
+
"--no-rdoc", "--no-ri",
|
57
|
+
"--install-dir", prefix
|
58
|
+
bin.rmtree
|
59
|
+
bin.mkpath
|
60
|
+
|
61
|
+
Pathname.glob("#{prefix}/gems/#{name}-#{version}/man/*").select do |file|
|
62
|
+
send("man#{$&}").install(file) if file.extname =~ /\d$/
|
63
|
+
end
|
64
|
+
|
65
|
+
ruby_libs = Dir.glob("#{prefix}/gems/*/lib")
|
66
|
+
Pathname.glob("#{prefix}/gems/#{name}-#{version}/bin/*").each do |file|
|
67
|
+
(bin+file.basename).open('w') do |f|
|
68
|
+
f << <<-RUBY
|
69
|
+
#!/usr/bin/env ruby
|
70
|
+
ENV['GEM_HOME']="#{prefix}"
|
71
|
+
$:.unshift(#{ruby_libs.map(&:inspect).join(",")})
|
72
|
+
load "#{file}"
|
73
|
+
RUBY
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
class TumblrRb < RubyGemFormula
|
80
|
+
url "http://rubygems.org/downloads/<%= gem_name %>-<%= version %>.gem"
|
81
|
+
homepage "http://rubygems.org/gems/<%= gem_name %>"
|
82
|
+
version "<%= version %>"
|
83
|
+
end
|
data/lib/tumblr/version.rb
CHANGED
data/share/tumblr-rb.rb
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# This is a generated file. Run `rake brew`
|
2
|
+
require 'formula'
|
3
|
+
|
4
|
+
class RubyGemFormula < Formula
|
5
|
+
class NoopDownloadStrategy < AbstractDownloadStrategy
|
6
|
+
def fetch; end
|
7
|
+
def stage; end
|
8
|
+
end
|
9
|
+
|
10
|
+
def download_strategy
|
11
|
+
NoopDownloadStrategy
|
12
|
+
end
|
13
|
+
|
14
|
+
def install
|
15
|
+
# set GEM_HOME and GEM_PATH to make sure we package all the dependent gems
|
16
|
+
# together without accidently picking up other gems on the gem path since
|
17
|
+
# they might not be there if, say, we change to a different rvm gemset
|
18
|
+
ENV['GEM_HOME']="#{prefix}"
|
19
|
+
ENV['GEM_PATH']="#{prefix}"
|
20
|
+
system "gem", "install", "tumblr-rb",
|
21
|
+
"--version", "2.0.0",
|
22
|
+
"--no-rdoc", "--no-ri",
|
23
|
+
"--install-dir", prefix
|
24
|
+
bin.rmtree
|
25
|
+
bin.mkpath
|
26
|
+
|
27
|
+
Pathname.glob("#{prefix}/gems/#{name}-#{version}/man/*").select do |file|
|
28
|
+
send("man#{$&}").install(file) if file.extname =~ /\d$/
|
29
|
+
end
|
30
|
+
|
31
|
+
ruby_libs = Dir.glob("#{prefix}/gems/*/lib")
|
32
|
+
Pathname.glob("#{prefix}/gems/#{name}-#{version}/bin/*").each do |file|
|
33
|
+
(bin+file.basename).open('w') do |f|
|
34
|
+
f << <<-RUBY
|
35
|
+
#!/usr/bin/env ruby
|
36
|
+
ENV['GEM_HOME']="#{prefix}"
|
37
|
+
$:.unshift(#{ruby_libs.map(&:inspect).join(",")})
|
38
|
+
load "#{file}"
|
39
|
+
RUBY
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
class TumblrRb < RubyGemFormula
|
46
|
+
url "http://rubygems.org/downloads/tumblr-rb-2.0.0.gem"
|
47
|
+
homepage "http://rubygems.org/gems/tumblr-rb"
|
48
|
+
version "2.0.0"
|
49
|
+
end
|
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tumblr-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0
|
5
|
-
prerelease:
|
4
|
+
version: 2.0.0
|
5
|
+
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Mark Wunsch
|
@@ -100,6 +100,7 @@ files:
|
|
100
100
|
- man/tumblr.5
|
101
101
|
- man/tumblr.5.html
|
102
102
|
- man/tumblr.5.ronn
|
103
|
+
- share/tumblr-rb.rb
|
103
104
|
- spec/fixtures/posts.json
|
104
105
|
- spec/fixtures/typical_animated_gif.gif
|
105
106
|
- spec/spec_helper.rb
|
@@ -122,13 +123,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
122
123
|
version: '0'
|
123
124
|
segments:
|
124
125
|
- 0
|
125
|
-
hash:
|
126
|
+
hash: -998266851628618470
|
126
127
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
127
128
|
none: false
|
128
129
|
requirements:
|
129
|
-
- - ! '
|
130
|
+
- - ! '>='
|
130
131
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
132
|
+
version: '0'
|
133
|
+
segments:
|
134
|
+
- 0
|
135
|
+
hash: -998266851628618470
|
132
136
|
requirements: []
|
133
137
|
rubyforge_project:
|
134
138
|
rubygems_version: 1.8.23
|