Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

General maintenance #15

Closed
wants to merge 9 commits into from

2 participants

@sferik
Collaborator

I've made a variety of general maintenance updates to twurl, none of which should result in any change in behavior. Highlights:

  • Replacing RCov with SimpleCov to measure code coverage. RCov hasn't been updated since 2009 and doesn't work reliably on Ruby 1.9.
  • Replacing test-unit with minitest. This is the new default in Ruby 1.9 and offers backwards compatibility to earlier versions of ruby via a gem, which is specified as a development dependency in the gemspec.
  • Replacing rake/gempackagetask with rubygems/package_task, removing a deprecation warning.
  • Adding JRuby support by including jruby-openssl in the Gemfile. This is primarily to make tests pass on JRuby.
  • Adding a .travis.yml file for Travis CI configuration. If you enable the Travis post-commit hook on GitHub, this will ensure compatibility with a variety of Ruby versions after each commit. Highly recommended!
  • Opt-in for testing with rubygems-test (a.k.a. GemTesters).
@marcel
@sferik
Collaborator

If you don't mind adding me as a contributor on the repo, I'm happy to help triage bugs.

As I mentioned above, these changes should only affect people developing the gem. Code that actually gets packaged should be untouched by these changes. If someone wants to hack on twurl, I don't think it's unreasonable to expect them to use a modern version of Ruby and rubygems.

@marcel
@sferik
Collaborator

Check out the early results from GemTesters: http://test.rubygems.org/gems/twurl/v/0.6.4

To run the tests on your box, you can simply:

gem install rubygems-test
gem install twurl -v 0.6.4
gem test twurl

Here are detailed instructions to set up Travis CI:

  1. Go to http://travis-ci.org/
  2. Click the "Sign in with GitHub" link (in the upper right)
  3. Once you're signed in, go to: http://travis-ci.org/profile
  4. Copy your Travis Token to your pasteboard
  5. Go to the Service Hooks Admin page for twurl
  6. Select Travis, paste in your Token, check the Active box and press "Update Settings"
  7. If you select Travis again and press "Test Hook", you should see your first CI build appear at http://travis-ci.org/#!/marcel/twurl
@sferik sferik closed this
@sferik
Collaborator

If you want to add me as a rubygems pusher as well, you can type the command:

gem owner twurl --add sferik@gmail.com

:D

@marcel
@sferik
Collaborator

Ooh, looks like you did that already. Thanks, Marcel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
0  .gemtest
No changes.
View
40 .gitignore
@@ -1,4 +1,40 @@
-coverage
-.rake_tasks
+*.gem
+*.rbc
+*.sw[a-p]
+*.tmproj
+*.tmproject
+*.un~
+*~
.DS_Store
+.Spotlight-V100
+.Trashes
+._*
+.bundle
+.config
+.directory
+.elc
+.emacs.desktop
+.emacs.desktop.lock
+.redcar
+.yardoc
+Desktop.ini
+Gemfile.lock
+Icon?
+InstalledFiles
+Session.vim
+Thumbs.db
+\#*\#
+_yardoc
+auto-save-list
+coverage
+doc
+lib/bundler/man
pkg
+pkg/*
+rdoc
+spec/reports
+test/tmp
+test/version_tmp
+tmp
+tmtags
+tramp
View
7 .travis.yml
@@ -0,0 +1,7 @@
+rvm:
+ - 1.8.7
+ - 1.9.2
+ - 1.9.3
+ - jruby
+ - rbx
+ - ree
View
6 Gemfile
@@ -1,3 +1,7 @@
-source "http://rubygems.org"
+source 'http://rubygems.org'
+
+platforms :jruby do
+ gem 'jruby-openssl', '~> 0.7'
+end
gemspec
View
23 Gemfile.lock
@@ -1,23 +0,0 @@
-PATH
- remote: .
- specs:
- twurl (0.6.1)
- oauth (~> 0.4)
-
-GEM
- remote: http://rubygems.org/
- specs:
- oauth (0.4.3)
- rake (0.8.7)
- rr (1.0.0)
- test-unit (2.1.1)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- oauth (~> 0.4)
- rake (~> 0.8)
- rr (~> 1.0)
- test-unit (~> 2.1)
- twurl!
View
26 Rakefile 100644 → 100755
@@ -1,11 +1,6 @@
-require 'rubygems'
-require 'rake'
+#!/usr/bin/env rake
require 'rake/testtask'
-require 'rake/gempackagetask'
-
-require File.dirname(__FILE__) + '/lib/twurl'
-
-library_root = File.dirname(__FILE__)
+require 'rubygems/package_task'
task :default => :test
@@ -14,25 +9,10 @@ Rake::TestTask.new do |test|
test.verbose = true
end
-namespace :test do
- desc "Analyze test coverage"
- task :coverage do
- system("rcov -x Library -x support --sort coverage #{File.join(library_root, 'test/*_test.rb')}")
- system("open #{File.join(library_root, 'coverage/index.html')}") if PLATFORM['darwin']
- end
-
- namespace :coverage do
- desc "Remove artifacts generated from coverage analysis"
- task :clobber do
- rm_r 'coverage' rescue nil
- end
- end
-end
-
namespace :dist do
spec = Gem::Specification.load('twurl.gemspec')
- Rake::GemPackageTask.new(spec) do |pkg|
+ Gem::PackageTask.new(spec) do |pkg|
pkg.need_tar_gz = true
pkg.package_files.include('{lib,bin,test}/**/*')
pkg.package_files.include('README')
View
8 test/account_information_controller_test.rb
@@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/test_helper'
-class Twurl::AccountInformationController::DispatchWithNoAuthorizedAccountsTest < Test::Unit::TestCase
+class Twurl::AccountInformationController::DispatchWithNoAuthorizedAccountsTest < MiniTest::Unit::TestCase
attr_reader :options, :client, :controller
def setup
@options = Twurl::Options.new
@@ -16,7 +16,7 @@ def test_message_indicates_when_no_accounts_are_authorized
end
end
-class Twurl::AccountInformationController::DispatchWithOneAuthorizedAccountTest < Test::Unit::TestCase
+class Twurl::AccountInformationController::DispatchWithOneAuthorizedAccountTest < MiniTest::Unit::TestCase
attr_reader :options, :client, :controller
def setup
@options = Twurl::Options.test_exemplar
@@ -34,7 +34,7 @@ def test_authorized_account_is_displayed_and_marked_as_the_default
end
end
-class Twurl::AccountInformationController::DispatchWithOneUsernameThatHasAuthorizedMultipleAccountsTest < Test::Unit::TestCase
+class Twurl::AccountInformationController::DispatchWithOneUsernameThatHasAuthorizedMultipleAccountsTest < MiniTest::Unit::TestCase
attr_reader :default_client_options, :default_client, :other_client_options, :other_client, :controller
def setup
@default_client_options = Twurl::Options.test_exemplar
@@ -58,4 +58,4 @@ def test_authorized_account_is_displayed_and_marked_as_the_default
controller.dispatch
end
-end
+end
View
4 test/alias_controller_test.rb
@@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/test_helper'
-class Twurl::AliasesController::DispatchTest < Test::Unit::TestCase
+class Twurl::AliasesController::DispatchTest < MiniTest::Unit::TestCase
attr_reader :options, :client
def setup
@options = Twurl::Options.test_exemplar
@@ -50,4 +50,4 @@ def test_when_no_path_is_provided_nothing_happens
controller = Twurl::AliasesController.new(client, options)
controller.dispatch
end
-end
+end
View
4 test/authorization_controller_test.rb
@@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/test_helper'
-class Twurl::AuthorizationController::DispatchTest < Test::Unit::TestCase
+class Twurl::AuthorizationController::DispatchTest < MiniTest::Unit::TestCase
attr_reader :options, :client, :controller
def setup
@options = Twurl::Options.new
@@ -27,4 +27,4 @@ def test_failed_authorization_does_not_save_client
end
end
include ErrorCases
-end
+end
View
4 test/cli_options_test.rb
@@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/test_helper'
-class Twurl::Options::Test < Test::Unit::TestCase
+class Twurl::Options::Test < MiniTest::Unit::TestCase
attr_reader :options
def setup
@options = Twurl::Options.new
@@ -20,4 +20,4 @@ def test_ssl_is_enabled_if_the_protocol_is_https
options.protocol = 'https'
assert options.ssl?
end
-end
+end
View
4 test/cli_test.rb
@@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/test_helper'
-class Twurl::CLI::OptionParsingTest < Test::Unit::TestCase
+class Twurl::CLI::OptionParsingTest < MiniTest::Unit::TestCase
module CommandParsingTests
def test_no_command_specified_falls_to_default_command
options = Twurl::CLI.parse_options(['/1/url/does/not/matter.xml'])
@@ -133,7 +133,7 @@ def test_not_specifying_host_sets_it_to_the_default
def test_setting_host_updates_to_requested_value
custom_host = 'localhost:3000'
- assert_not_equal Twurl::Options::DEFAULT_HOST, custom_host
+ assert Twurl::Options::DEFAULT_HOST != custom_host
[['-H', custom_host], ['--host', custom_host]].each do |option_combination|
options = Twurl::CLI.parse_options(option_combination)
View
6 test/configuration_controller_test.rb
@@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/test_helper'
-class Twurl::ConfigurationController::DispatchTest < Test::Unit::TestCase
+class Twurl::ConfigurationController::DispatchTest < MiniTest::Unit::TestCase
def test_error_message_is_displayed_if_setting_is_unrecognized
options = Twurl::Options.test_exemplar
client = Twurl::OAuthClient.test_exemplar
@@ -15,7 +15,7 @@ def test_error_message_is_displayed_if_setting_is_unrecognized
end
end
-class Twurl::ConfigurationController::DispatchDefaultSettingTest < Test::Unit::TestCase
+class Twurl::ConfigurationController::DispatchDefaultSettingTest < MiniTest::Unit::TestCase
def test_setting_default_profile_just_by_username
options = Twurl::Options.test_exemplar
client = Twurl::OAuthClient.test_exemplar
@@ -41,4 +41,4 @@ def test_setting_default_profile_by_username_and_consumer_key
controller = Twurl::ConfigurationController.new(client, options)
controller.dispatch
end
-end
+end
View
2  test/oauth_client_test.rb
@@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/test_helper'
-class Twurl::OAuthClient::AbstractOAuthClientTest < Test::Unit::TestCase
+class Twurl::OAuthClient::AbstractOAuthClientTest < MiniTest::Unit::TestCase
attr_reader :client, :options
def setup
Twurl::OAuthClient.instance_variable_set(:@rcfile, nil)
View
14 test/rcfile_test.rb
@@ -1,12 +1,12 @@
require File.dirname(__FILE__) + '/test_helper'
-class Twurl::RCFile::PathConstructionTest < Test::Unit::TestCase
+class Twurl::RCFile::PathConstructionTest < MiniTest::Unit::TestCase
def test_file_path_appends_file_to_directory
assert_equal File.join(Twurl::RCFile.directory, Twurl::RCFile::FILE), Twurl::RCFile.file_path
end
end
-class Twurl::RCFile::LoadingTest < Test::Unit::TestCase
+class Twurl::RCFile::LoadingTest < MiniTest::Unit::TestCase
def test_load_parses_and_loads_file_if_it_exists
mock(YAML).load_file(Twurl::RCFile.file_path).times(1)
mock(Twurl::RCFile).default_rcfile_structure.never
@@ -22,7 +22,7 @@ def test_load_returns_default_file_structure_if_file_does_not_exist
end
end
-class Twurl::RCFile::InitializationTest < Test::Unit::TestCase
+class Twurl::RCFile::InitializationTest < MiniTest::Unit::TestCase
def test_initializing_when_the_file_does_not_exist_loads_default_rcfile_structure
mock(YAML).load_file(Twurl::RCFile.file_path) { raise Errno::ENOENT }.times(1)
@@ -40,7 +40,7 @@ def test_initializing_when_the_file_does_exists_loads_content_of_file
end
end
-class Twurl::RCFile::DefaultProfileFromDefaultRCFileTest < Test::Unit::TestCase
+class Twurl::RCFile::DefaultProfileFromDefaultRCFileTest < MiniTest::Unit::TestCase
attr_reader :rcfile
def setup
mock(YAML).load_file(Twurl::RCFile.file_path) { raise Errno::ENOENT }.times(1)
@@ -66,7 +66,7 @@ def test_setting_default_profile
end
end
-class Twurl::RCFile::UpdatingTest < Test::Unit::TestCase
+class Twurl::RCFile::UpdatingTest < MiniTest::Unit::TestCase
attr_reader :rcfile
def setup
mock(YAML).load_file(Twurl::RCFile.file_path) { raise Errno::ENOENT }.times(1)
@@ -108,7 +108,7 @@ def test_adding_additional_clients_does_not_change_default_profile
end
end
-class Twurl::RCFile::SavingTest < Test::Unit::TestCase
+class Twurl::RCFile::SavingTest < MiniTest::Unit::TestCase
attr_reader :rcfile
def setup
delete_rcfile
@@ -138,4 +138,4 @@ def delete_rcfile
rescue Errno::ENOENT
# Do nothing
end
-end
+end
View
2  test/request_controller_test.rb
@@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/test_helper'
-class Twurl::RequestController::AbstractTestCase < Test::Unit::TestCase
+class Twurl::RequestController::AbstractTestCase < MiniTest::Unit::TestCase
attr_reader :options, :client, :controller
def setup
Twurl::CLI.output = StringIO.new
View
6 test/test_helper.rb
@@ -1,9 +1,11 @@
$:.unshift File.dirname(__FILE__) + '/../lib'
+require 'simplecov'
+SimpleCov.start
require 'twurl'
-require 'test/unit'
+require 'minitest/autorun'
require 'rr'
-class Test::Unit::TestCase
+class MiniTest::Unit::TestCase
include RR::Adapters::TestUnit
end
View
32 twurl.gemspec
@@ -1,25 +1,25 @@
-# -*- encoding: utf-8 -*-
-require File.expand_path("../lib/twurl/version", __FILE__)
+# encoding: utf-8
+require File.expand_path('../lib/twurl/version', __FILE__)
Gem::Specification.new do |s|
- s.name = "twurl"
- s.version = Twurl::Version
+ s.add_dependency 'oauth', '~> 0.4'
+ s.add_development_dependency 'rake', '~> 0.8'
+ s.add_development_dependency 'rr', '~> 1.0'
+ s.add_development_dependency 'simplecov', '~> 0.4'
+ s.add_development_dependency 'minitest', '~> 2.5'
s.authors = ["Marcel Molina", "Raffi Krikorian"]
- s.default_executable = "twurl"
s.description = %q{Curl for the Twitter API}
- s.email = ["marcel@twitter.com", "raffi@twitter.com"]
+ s.email = ['marcel@twitter.com', 'raffi@twitter.com']
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
- s.extra_rdoc_files = %w(README COPYING INSTALL)
+ s.extra_rdoc_files = %w(CHANGELOG COPYING INSTALL README)
s.files = `git ls-files`.split("\n")
- s.homepage = "http://github.com/marcel/twurl"
- s.rdoc_options = ["--title", "twurl -- OAuth-enabled curl for the Twitter API", "--main", "README", "--line-numbers", "--inline-source"]
- s.require_paths = ["lib"]
- s.rubyforge_project = "twurl"
- s.required_rubygems_version = Gem::Requirement.new(">= 1.3.6") if s.respond_to? :required_rubygems_version=
+ s.homepage = 'http://github.com/marcel/twurl'
+ s.name = 'twurl'
+ s.rdoc_options = ['--title', 'twurl -- OAuth-enabled curl for the Twitter API', '--main', 'README', '--line-numbers', '--inline-source']
+ s.require_paths = ['lib']
+ s.required_rubygems_version = Gem::Requirement.new('>= 1.3.6') if s.respond_to? :required_rubygems_version=
+ s.rubyforge_project = 'twurl'
s.summary = s.description
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
- s.add_development_dependency("rake", ["~> 0.8"])
- s.add_development_dependency("rr", ["~> 1.0"])
- s.add_development_dependency("test-unit", ["~> 2.1"])
- s.add_runtime_dependency("oauth", ["~> 0.4"])
+ s.version = Twurl::Version
end
Something went wrong with that request. Please try again.