Skip to content
This repository has been archived by the owner on Oct 29, 2023. It is now read-only.

Commit

Permalink
Rerrange files a bit to be more ruby/rubygem friendly. Add gemspec
Browse files Browse the repository at this point in the history
  • Loading branch information
james cook committed Oct 6, 2010
1 parent a8ff599 commit 3ed0840
Show file tree
Hide file tree
Showing 16 changed files with 46 additions and 7 deletions.
26 changes: 26 additions & 0 deletions .gemspec
@@ -0,0 +1,26 @@
# -*- encoding: utf-8 -*-
lib = File.expand_path('../lib/', __FILE__)
$:.unshift lib unless $:.include?(lib)

require "reddit/version"

Gem::Specification.new do |s|
s.name = "ruby_reddit_api"
s.version = Reddit::VERSION
s.platform = Gem::Platform::RUBY
s.authors = ["James Cook"]
s.email = ["jamecook@gmail.com"]
s.homepage = "http://github.com/jamescook/RubyRedditAPI"
s.summary = "Wrapper for reddit API"
s.description = "Wraps many reddit API functions such as submission and comments browsing, voting and messaging."
s.has_rdoc = false

s.required_rubygems_version = ">= 1.3.6"

s.add_dependency "httparty"
s.add_development_dependency "cucumber"

s.files = Dir.glob("{lib}/**/*") + %w(README)
s.test_files = Dir.glob("{features}/**/*")
s.require_path = 'lib'
end
1 change: 1 addition & 0 deletions .gitignore
@@ -1,3 +1,4 @@
*.gem
*.swp
*.swm
*.sw0
6 changes: 3 additions & 3 deletions README
@@ -1,10 +1,10 @@
Ruby Reddit Client v0.1.1
Ruby Reddit Client v0.1.8
==================
'Tested' with 1.9.2
Tested with 1.9.2

Usage:
=======
> require "lib/reddit.rb"
> require "ruby_reddit_api"
> r = Reddit::Api.new "user", "password"
> results = r.browse "ruby"
> results[0].upvote
Expand Down
9 changes: 9 additions & 0 deletions Rakefile
@@ -1,8 +1,17 @@
$:.unshift(File.dirname(__FILE__) + '/../../lib')
require 'cucumber/rake/task'
require "bundler/version"

Cucumber::Rake::Task.new do |t|
t.cucumber_opts = %w{--format pretty}
end

task :build do
system "gem build .gemspec"
end

task :release => :build do
system "gem push ruby_reddit_api-#{Reddit::VERSION}"
end

task :default => [:cucumber]
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
0.1.7
0.1.8
2 changes: 1 addition & 1 deletion features/step_definitions/base_steps.rb
@@ -1,4 +1,4 @@
require File.join( File.dirname(__FILE__), "..", "..", "lib", "reddit.rb")
require File.join( File.dirname(__FILE__), "..", "..", "lib", "ruby_reddit_api.rb")
Before do
Reddit::Base.instance_variable_set("@cookie", nil)
load_server_config
Expand Down
4 changes: 2 additions & 2 deletions lib/reddit.rb → lib/ruby_reddit_api.rb
@@ -1,11 +1,11 @@
$LOAD_PATH.unshift File.dirname(__FILE__)
$:.unshift File.dirname(__FILE__)

module Reddit
VERSION = File.exist?("VERSION") ? File.read("VERSION").chomp : ""
end

require "httparty"
require "json"
require "reddit/version"
require "reddit/base"
require "reddit/json_listing"
require "reddit/api"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions lib/ruby_reddit_api/version.rb
@@ -0,0 +1,3 @@
module Reddit
VERSION = File.exist?("VERSION") ? File.read("VERSION").chomp : ""
end
File renamed without changes.

0 comments on commit 3ed0840

Please sign in to comment.