Skip to content
This repository has been archived by the owner on Jan 30, 2019. It is now read-only.

Commit

Permalink
removing stupid shit
Browse files Browse the repository at this point in the history
  • Loading branch information
Oshuma committed May 14, 2010
1 parent e1ad8bc commit 066501a
Show file tree
Hide file tree
Showing 19 changed files with 25 additions and 1,031 deletions.
25 changes: 0 additions & 25 deletions Manifest.txt

This file was deleted.

37 changes: 10 additions & 27 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,31 +1,14 @@
# Look in the tasks/setup.rb file for the various options that can be
# configured in this Rakefile. The .rake files in the tasks directory
# are where the options are used.
require 'spec/rake/spectask'

load 'tasks/setup.rb'
task :default => :spec

ensure_in_path 'lib'
require 'pingfm'

task :default => 'spec:run'

PROJ.name = 'pingfm'
PROJ.authors = ['Krunoslav Husak', 'Dale Campbell', 'Kevin Williams']
PROJ.email = ['dale@save-state.net', 'kevwil@gmail.com']
PROJ.url = 'http://pingfm.rubyforge.org/'
PROJ.version = ENV['VERSION'] || Pingfm.version
PROJ.rubyforge.name = 'pingfm'
PROJ.readme_file = 'README'

PROJ.spec.opts << '--color'

namespace :gem do
desc 'create a gemspec file to support github gems'
task :gemspec => 'gem:prereqs' do
File.open("#{PROJ.name}.gemspec", 'w+') do |f|
f.write PROJ.gem._spec.to_ruby
end
end
desc 'Run the specs'
Spec::Rake::SpecTask.new(:spec) do |t|
t.spec_opts = ['--color']
t.spec_files = FileList['spec/**/*_spec.rb']
end

# EOF
desc 'Start a console loaded with the library'
task :console do
sh "irb -I ./lib -r 'pingfm'"
end
5 changes: 5 additions & 0 deletions bin/pingfm
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!/usr/bin/env ruby

# TODO: Rewrite this POS.
puts "The 'pingfm' binary will be rewritten as soon as the library is."
exit

# TODO: Eventually add some flags to support all Ping.fm functionality.

# TODO: Move this into a YAML config?
Expand Down
56 changes: 4 additions & 52 deletions lib/pingfm.rb
Original file line number Diff line number Diff line change
@@ -1,56 +1,8 @@
# $Id$
$LOAD_PATH.unshift File.dirname(__FILE__)

# Equivalent to a header guard in C/C++
# Used to prevent the class/module from being loaded more than once
unless defined? Pingfm
require 'pingfm/client'
require 'pingfm/keyloader'

module Pingfm

# :stopdoc:
VERSION = '1.0.2'
LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
# :startdoc:

# Returns the version string for the library.
#
def self.version
VERSION
end

# Returns the library path for the module. If any arguments are given,
# they will be joined to the end of the libray path using
# <tt>File.join</tt>.
#
def self.libpath( *args )
args.empty? ? LIBPATH : ::File.join(LIBPATH, *args)
end

# Returns the lpath for the module. If any arguments are given,
# they will be joined to the end of the path using
# <tt>File.join</tt>.
#
def self.path( *args )
args.empty? ? PATH : ::File.join(PATH, *args)
end

# Utility method used to rquire all files ending in .rb that lie in the
# directory below this file that has the same name as the filename passed
# in. Optionally, a specific _directory_ name can be passed in such that
# the _filename_ does not have to be equivalent to the directory.
#
def self.require_all_libs_relative_to( fname, dir = nil )
dir ||= ::File.basename(fname, '.*')
search_me = ::File.expand_path(
::File.join(::File.dirname(fname), dir, '**', '*.rb'))

Dir.glob(search_me).sort.each {|rb| require rb}
end

end # module Pingfm

Pingfm.require_all_libs_relative_to __FILE__

end # unless defined?

# EOF
end # Pingfm
17 changes: 4 additions & 13 deletions spec/pingfm_spec.rb
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
# $Id$
require 'spec_helper'

# TODO: LOTS of repetition here that can probably be refactored a bit.
# TODO: Split these specs into a pingfm/ subdirectory, moving the client specs into their own file.

require File.join(File.dirname(__FILE__), %w[spec_helper])

describe Pingfm, 'main module' do
describe Pingfm do
it 'should return the version string' do
Pingfm.version.should be_a_kind_of(String)
end

it 'should return the library path' do
Pingfm.libpath.should eql(Pingfm::LIBPATH)
end

it 'should return the path to the library' do
Pingfm.path.should eql(Pingfm::PATH)
Pingfm::VERSION.should be_a_kind_of(String)
end
end

Expand Down
14 changes: 2 additions & 12 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
# $Id$

require File.expand_path(
File.join(File.dirname(__FILE__), %w[.. lib pingfm]))
require 'spec'
require "#{File.dirname(__FILE__)}/../lib/pingfm"

# Spec::Runner.configure do |config|
# == Mock Framework
#
# RSpec uses it's own mocking framework by default. If you prefer to
# use mocha, flexmock or RR, uncomment the appropriate line:
#
# config.mock_with :mocha
# config.mock_with :flexmock
# config.mock_with :rr
# end

def init_ok_response(service_type)
Expand Down
81 changes: 0 additions & 81 deletions tasks/ann.rake

This file was deleted.

21 changes: 0 additions & 21 deletions tasks/bones.rake

This file was deleted.

Loading

0 comments on commit 066501a

Please sign in to comment.