Skip to content

Commit

Permalink
Merge branch 'release/0.2'
Browse files Browse the repository at this point in the history
* release/0.2: (76 commits)
  Updated the rakefile.
  Version bump to 0.2.0
  bump version to 0.2
  Allow group_count on enumerable to work without a block
  Added latest pipes jar.
  Small tweaks.
  Don't change a property unnecessarilly.
  properties setter.
  There's nothing to prevent classes from being extensions.
  Added a range to most_frequent which makes it much more useful.
  Refactor bulk_job into its own module.
  Shortcut to print multiple properties from the elements in a route.
  Added better options to to_route
  Make sure all add_extension methods return self so they are chainable.
  Make group_count without arguments group on the element itself and add most_frequent and all_but_most_frequent because I've needed them in a couple of places.
  make #one? more robust
  minor change...
  Reuse a route by changing its source.
  enumerable .one? and .many?
  Add extensions on .results
  ...
  • Loading branch information
Darrick Wiebe committed Dec 20, 2010
2 parents 0376bb1 + 0c8e621 commit 7405063
Show file tree
Hide file tree
Showing 72 changed files with 1,572 additions and 891 deletions.
5 changes: 5 additions & 0 deletions .document
@@ -0,0 +1,5 @@
lib/**/*.rb
bin/*
-
features/**/*.feature
LICENSE.txt
17 changes: 17 additions & 0 deletions .gitignore
@@ -1,3 +1,20 @@
# rcov generated
coverage

# rdoc generated
rdoc

# yard generated
doc
.yardoc

# bundler
.bundle

# jeweler generated
pkg

# Project specific
*.graph
*.db
vendor/pipes*.jar
Expand Down
5 changes: 5 additions & 0 deletions CONTRIBUTORS
@@ -0,0 +1,5 @@
Maintainer:
Darrick Wiebe <darrick@innatesoftware.com>

Contributors:
*
24 changes: 24 additions & 0 deletions LICENSE.txt
@@ -0,0 +1,24 @@
Copyright (c) 2010, TinkerPop [http://tinkerpop.com]
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the TinkerPop nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL TINKERPOP BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 changes: 16 additions & 16 deletions Rakefile
Expand Up @@ -11,16 +11,26 @@ begin
gem.email = "darrick@innatesoftware.com"
gem.homepage = "http://github.com/pangloss/pacer"
gem.authors = ["Darrick Wiebe"]
gem.license = "MIT"
gem.add_dependency "nokogiri", "~> 1.4"
gem.add_development_dependency "rspec", "~> 2.1"
gem.add_development_dependency "rr", "~> 1.0"
gem.files = FileList['lib/**/*.rb', 'script/*', '[A-Z]*', 'spec/**/*', 'vendor/*'].to_a
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
end
Jeweler::GemcutterTasks.new
Jeweler::RubygemsDotOrgTasks.new
rescue LoadError
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
end

begin
require 'yard'
YARD::Rake::YardocTask.new
rescue LoadError
puts "YARD not available. gem install yard"
end

if Config::CONFIG['host_os'] =~ /mswin/
def jruby_path
Pathname.new ENV['path'].split(';').grep(/jruby/).first
Expand All @@ -44,32 +54,22 @@ if Config::CONFIG['host_os'] =~ /mswin/
end
end
task :install => jgem
task :build => jgem
end
end


require 'spec/rake/spectask'
Spec::Rake::SpecTask.new(:spec) do |spec|
spec.libs << 'lib' << 'spec'
spec.spec_files = FileList['spec/**/*_spec.rb']
require 'rspec/core'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |spec|
spec.pattern = FileList['spec/**/*_spec.rb']
end

Spec::Rake::SpecTask.new(:rcov) do |spec|
spec.libs << 'lib' << 'spec'
RSpec::Core::RakeTask.new(:rcov) do |spec|
spec.pattern = 'spec/**/*_spec.rb'
spec.rcov = true
end

task :spec => :check_dependencies

task :default => :spec

require 'rake/rdoctask'
Rake::RDocTask.new do |rdoc|
version = File.exist?('VERSION') ? File.read('VERSION') : ""

rdoc.rdoc_dir = 'rdoc'
rdoc.title = "pacer #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
0.1.1
0.2.0
43 changes: 35 additions & 8 deletions lib/pacer.rb
Expand Up @@ -2,7 +2,7 @@
require 'pp'

module Pacer
unless defined? Pacer::VERSION
unless const_defined? :VERSION
VERSION = '0.1.0'
PATH = File.expand_path(File.join(File.dirname(__FILE__), '..'))
$:.unshift File.join(PATH, 'lib')
Expand All @@ -12,8 +12,10 @@ module Pacer
exit 1
end

START_TIME = Time.now

require File.join(PATH, 'vendor/blueprints-neo4j-adapter-0.1-SNAPSHOT-standalone.jar')
require File.join(PATH, 'vendor/neo4j-lucene-index-0.2-1.2.M04.jar')
require File.join(PATH, 'vendor/neo4j-lucene-index-0.2-1.2.M05.jar')
end

require 'pacer/graph'
Expand All @@ -22,14 +24,29 @@ module Pacer
require 'pacer/neo4j'
require 'pacer/tg'
require 'pacer/support'
require 'pacer/utils'

class << self
# Reload all Ruby files in the Pacer library. Useful for debugging in the
# console. Does not do any of the fancy stuff that Rails reloading does.
# Certain types of changes will still require restarting the session.
attr_accessor :debug_info

# Returns the time pacer was last reloaded (or when it was started).
def reload_time
@reload_time || START_TIME
end

# Reload all Ruby modified files in the Pacer library. Useful for debugging
# in the console. Does not do any of the fancy stuff that Rails reloading
# does. Certain types of changes will still require restarting the
# session.
def reload!
Dir[File.join(PATH, 'lib/**/*.rb')].each { |file| load file }
true
require 'pathname'
Pathname.new(__FILE__).parent.find do |path|
if path.extname == '.rb' and path.mtime > reload_time
puts path.to_s
load path.to_s
end
end
@reload_time = Time.now
end

# Set to true to prevent inspecting any route from printing
Expand All @@ -44,7 +61,7 @@ def hide_route_elements

# Returns how many terminal columns we have.
def columns
@columns || 120
@columns || 150
end

# Tell the graph how many terminal columns we have.
Expand All @@ -63,6 +80,16 @@ def inspect_limit=(n)
@inspect_limit = n
end

def verbose=(v)
@verbose = v
end

def verbose?
@verbose = true if @verbose.nil?
@verbose
end
alias verbose verbose?

def vertex?(element)
element.is_a? com.tinkerpop.blueprints.pgm.Vertex
end
Expand Down

0 comments on commit 7405063

Please sign in to comment.