Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make RSpec examples pass #1

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ doc
# jeweler generated
pkg

# don't track Gemfile.lock in gem
*.lock

# Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
#
# * Create a file at ~/.gitignore
Expand Down
Empty file added .rspec
Empty file.
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
source "http://rubygems.org"
source "https://rubygems.org"
# Add dependencies required to use your gem here.
# Example:
# gem "activesupport", ">= 2.3.5"
gemspec

gem "anvl", :git => "git://github.com/uklibraries/anvl.git"
14 changes: 12 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
GIT
remote: git://github.com/uklibraries/anvl.git
revision: 285651d100482cb6204a7c3857057d2bf40c278d
specs:
anvl (0.3.0)

PATH
remote: .
specs:
Expand All @@ -8,16 +14,17 @@ PATH
namaste

GEM
remote: http://rubygems.org/
remote: https://rubygems.org/
specs:
anvl (0.3.0)
ZenTest (4.9.3)
checkm (0.1.1)
diff-lcs (1.1.3)
i18n (0.6.0)
lockit (0.1.2)
namaste (0.3.0)
i18n
rake (0.9.2.2)
redgreen (1.2.2)
rspec (2.11.0)
rspec-core (~> 2.11.0)
rspec-expectations (~> 2.11.0)
Expand All @@ -32,8 +39,11 @@ PLATFORMS
ruby

DEPENDENCIES
ZenTest
anvl!
bundler
dflat!
rake
redgreen
rspec
yard
3 changes: 3 additions & 0 deletions dflat.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Gem::Specification.new do |s|

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Chris Beer"]
s.summary = %q{Ruby Dflat implementation}
s.date = %q{2011-06-12}
s.email = %q{[email protected]}
s.extra_rdoc_files = [
Expand All @@ -25,7 +26,9 @@ Gem::Specification.new do |s|

s.add_development_dependency "rake"
s.add_development_dependency "bundler"
s.add_development_dependency "redgreen"
s.add_development_dependency "rspec"
s.add_development_dependency 'yard'
s.add_development_dependency "ZenTest"
end

28 changes: 14 additions & 14 deletions lib/dflat/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ def add src, dest, options = {}

manifest!
lock
m = manifest.add dest, :base => data_path
File.open(File.join(path, 'manifest.txt'), 'w') do |f|
f.write(m.to_s)
manifest.add dest, :options => {:path => data_path}
File.open(manifest_path, 'w') do |f|
f.write(manifest.to_s)
end

unlock
Expand All @@ -75,14 +75,14 @@ def remove list, options = {}
list = [list] if list.instance_of? String
FileUtils.rm list.map { |x| File.join(data_path, x) }, options

m = manifest!
manifest!
lock
list.each do |l|
m = m.remove l
manifest.remove l
end

File.open(File.join(path, 'manifest.txt'), 'w') do |f|
f.write(m.to_s)
File.open(manifest_path, 'w') do |f|
f.write(manifest.to_s)
end
unlock
end
Expand Down Expand Up @@ -142,9 +142,9 @@ def initialize path
def add source, dest, options = {}
manifest!
f = @redd.add source, dest, options
m = manifest.add dest, :base => File.join(data_path, 'add')
File.open(File.join(path, 'manifest.txt'), 'w') do |f|
f.write(m.to_s)
manifest.add dest, :options => {:path => File.join(data_path, 'add')}
File.open(manifest_path, 'w') do |f|
f.write(manifest.to_s)
end

f
Expand All @@ -153,13 +153,13 @@ def add source, dest, options = {}
def remove list, options = {}
list = [list] if list.instance_of? String
@redd.remove list.map { |x| x }, options
m = manifest!
manifest!
list.each do |l|
m = m.remove l
manifest.remove l
end

File.open(File.join(path, 'manifest.txt'), 'w') do |f|
f.write(m.to_s)
File.open(manifest_path, 'w') do |f|
f.write(manifest.to_s)
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/dflat_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
file = @dflat.current.add 'LICENSE.txt', 'producer/abcdef'
lines = @dflat.current.manifest!.to_s.split "\n"
lines[0].should == '#%checkm_0.7'
lines[1].should =~ /provider\/abcdef/
lines[1].should =~ /producer\/abcdef/
@dflat.current.manifest.should be_valid
end

Expand Down