smilodon 0.2.8 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,53 @@
1
+ populator.log
2
+
3
+ # rcov generated
4
+ coverage
5
+
6
+ # rdoc generated
7
+ rdoc
8
+
9
+ # yard generated
10
+ doc
11
+ .yardoc
12
+
13
+ # bundler
14
+ .bundle
15
+
16
+ # jeweler generated
17
+ pkg
18
+
19
+ # rbenv
20
+ .rbenv-version
21
+
22
+ # Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
23
+ #
24
+ # * Create a file at ~/.gitignore
25
+ # * Include files you want ignored
26
+ # * Run: git config --global core.excludesfile ~/.gitignore
27
+ #
28
+ # After doing this, these files will be ignored in all your git projects,
29
+ # saving you from having to 'pollute' every project you touch with them
30
+ #
31
+ # Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
32
+ #
33
+ # For MacOS:
34
+ #
35
+ #.DS_Store
36
+
37
+ # For TextMate
38
+ #*.tmproj
39
+ #tmtags
40
+
41
+ # For emacs:
42
+ #*~
43
+ #\#*
44
+ #.\#*
45
+
46
+ # For vim:
47
+ #*.swp
48
+
49
+ # For redcar:
50
+ #.redcar
51
+
52
+ # For rubinius:
53
+ #*.rbc
data/Gemfile CHANGED
@@ -3,9 +3,6 @@ source 'http://rubygems.org'
3
3
  gem 'logging'
4
4
 
5
5
  group :development do
6
- gem 'jeweler', '~> 1.6.0'
7
- gem 'bundler', '~> 1.0.0'
8
- gem 'rspec', '~> 2.3.0'
9
- gem 'rcov', '>= 0'
10
- gem 'yard', '~> 0.6.0'
6
+ gem 'rake'
7
+ gem 'rspec'
11
8
  end
data/Gemfile.lock CHANGED
@@ -1,34 +1,24 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- diff-lcs (1.1.2)
5
- git (1.2.5)
6
- jeweler (1.6.0)
7
- bundler (~> 1.0.0)
8
- git (>= 1.2.5)
9
- rake
10
- little-plugger (1.1.2)
11
- logging (1.5.0)
12
- little-plugger (>= 1.1.2)
13
- rake (0.8.7)
14
- rcov (0.9.9)
15
- rspec (2.3.0)
16
- rspec-core (~> 2.3.0)
17
- rspec-expectations (~> 2.3.0)
18
- rspec-mocks (~> 2.3.0)
19
- rspec-core (2.3.1)
20
- rspec-expectations (2.3.0)
21
- diff-lcs (~> 1.1.2)
22
- rspec-mocks (2.3.0)
23
- yard (0.6.8)
4
+ diff-lcs (1.1.3)
5
+ little-plugger (1.1.3)
6
+ logging (1.7.2)
7
+ little-plugger (>= 1.1.3)
8
+ rake (0.9.2.2)
9
+ rspec (2.10.0)
10
+ rspec-core (~> 2.10.0)
11
+ rspec-expectations (~> 2.10.0)
12
+ rspec-mocks (~> 2.10.0)
13
+ rspec-core (2.10.0)
14
+ rspec-expectations (2.10.0)
15
+ diff-lcs (~> 1.1.3)
16
+ rspec-mocks (2.10.1)
24
17
 
25
18
  PLATFORMS
26
19
  ruby
27
20
 
28
21
  DEPENDENCIES
29
- bundler (~> 1.0.0)
30
- jeweler (~> 1.6.0)
31
22
  logging
32
- rcov
33
- rspec (~> 2.3.0)
34
- yard (~> 0.6.0)
23
+ rake
24
+ rspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Umang Chouhan
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc CHANGED
@@ -1,6 +1,6 @@
1
1
  == Populator http://travis-ci.org/optimis/populator.png
2
2
 
3
- http://dinofelis-cristata.artspots.com/image_sizes/0012/1985/smilodon_populator.jpg
3
+ http://www.paleospot.com/illustrations/Smilodon.jpg
4
4
 
5
5
  Populator includes helper methods to ease parsing data files. Assigning a header and iterating over rows is handled by the module via a simple configuration.
6
6
 
data/Rakefile CHANGED
@@ -1,44 +1,2 @@
1
- # encoding: utf-8
2
-
3
- require 'rubygems'
4
- require 'bundler'
5
- begin
6
- Bundler.setup(:default, :development)
7
- rescue Bundler::BundlerError => e
8
- $stderr.puts e.message
9
- $stderr.puts "Run `bundle install` to install missing gems"
10
- exit e.status_code
11
- end
12
- require 'rake'
13
-
14
- require 'jeweler'
15
- Jeweler::Tasks.new do |gem|
16
- # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
- gem.name = "smilodon"
18
- gem.homepage = "http://github.com/optimis/smilodon"
19
- gem.license = "MIT"
20
- gem.summary = %Q{Smilodon is a utility to parse data files.}
21
- gem.description = %Q{Smilodon is a utility to parse data files.}
22
- gem.email = "uchouhan@optimiscorp.com"
23
- gem.authors = ["Umang Chouhan"]
24
- # dependencies defined in Gemfile
25
- end
26
- Jeweler::RubygemsDotOrgTasks.new
27
-
28
- require 'rspec/core'
29
- require 'rspec/core/rake_task'
30
- RSpec::Core::RakeTask.new(:spec) do |spec|
31
- spec.pattern = FileList['spec/**/*_spec.rb']
32
- end
33
-
34
- RSpec::Core::RakeTask.new(:rcov) do |spec|
35
- spec.pattern = 'spec/**/*_spec.rb'
36
- spec.rcov = true
37
- end
38
-
39
- task :default => :spec
40
-
41
- require 'yard'
42
- YARD::Rake::YardocTask.new
43
-
44
- require 'smilodon/tasks'
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.8
1
+ 0.2.9
@@ -0,0 +1,12 @@
1
+ require 'smilodon'
2
+ require 'rails'
3
+
4
+ module Smilodon
5
+ class Railtie < Rails::Railtie
6
+ railtie_name :smilodon
7
+
8
+ rake_tasks do
9
+ load 'tasks/smilodon.rake'
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,3 @@
1
+ module Smilodon
2
+ VERSION = '0.3.0'
3
+ end
data/lib/smilodon.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'smilodon/errors'
2
2
  require 'smilodon/logger'
3
- require 'csv'
3
+ require 'smilodon/railtie' if defined?(Rails)
4
4
 
5
5
  # Smilodon includes helper methods to ease parsing data files.
6
6
  # Assigning a header and iterating over rows is handled by the
@@ -47,12 +47,12 @@ module Smilodon
47
47
 
48
48
  options = args.last.is_a?(Hash) ? args.pop : {}
49
49
 
50
-
51
50
  self.directory = if defined?(Rails)
52
51
  "#{Rails.root}/#{options[:directory] || DIRECTORY}"
53
52
  else
54
53
  options[:directory] || DIRECTORY
55
54
  end
55
+
56
56
  self.type = options[:type] || TYPE
57
57
  self.header = options[:header]
58
58
  self.before = options[:before]
@@ -63,7 +63,6 @@ module Smilodon
63
63
  #
64
64
  # @return [Boolean] Returns true if all rows are processed successfully.
65
65
  def run
66
-
67
66
  files.each do |f|
68
67
  # Call the before hook if defined.
69
68
  #
@@ -92,7 +91,6 @@ module Smilodon
92
91
  end
93
92
 
94
93
  private
95
-
96
94
  def grab_files
97
95
  Dir.glob("#{directory}/*").map do |file|
98
96
  File.basename(file, File.extname(file))
data/smilodon.gemspec CHANGED
@@ -1,75 +1,19 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
1
  # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/smilodon/version', __FILE__)
5
3
 
6
- Gem::Specification.new do |s|
7
- s.name = %q{smilodon}
8
- s.version = "0.2.8"
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = [ 'Umang Chouhan', 'Hubert Huang', 'Atsuya Takagi' ]
6
+ gem.email = [ 'uchouhan@optimiscorp.com' ]
7
+ gem.description = 'Smilodon is a utility to parse data files.'
8
+ gem.summary = 'Smilodon is a utility to parse data files.'
9
+ gem.homepage = 'http://github.com/optimis/smilodon'
9
10
 
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Umang Chouhan"]
12
- s.date = %q{2012-02-15}
13
- s.description = %q{Smilodon is a utility to parse data files.}
14
- s.email = %q{uchouhan@optimiscorp.com}
15
- s.extra_rdoc_files = [
16
- "LICENSE.txt",
17
- "README.rdoc"
18
- ]
19
- s.files = [
20
- ".document",
21
- ".rspec",
22
- "Gemfile",
23
- "Gemfile.lock",
24
- "LICENSE.txt",
25
- "README.rdoc",
26
- "Rakefile",
27
- "VERSION",
28
- "lib/smilodon.rb",
29
- "lib/smilodon/errors.rb",
30
- "lib/smilodon/fakes.rb",
31
- "lib/smilodon/logger.rb",
32
- "lib/smilodon/tasks.rb",
33
- "lib/tasks/populate.rake",
34
- "lib/tasks/populate.yml",
35
- "smilodon.gemspec",
36
- "spec/lib/smilodon_spec.rb",
37
- "spec/lib/tasks/populate_spec.rb",
38
- "spec/spec_helper.rb",
39
- "spec/test_files/bar.csv",
40
- "spec/test_files/foo.csv"
41
- ]
42
- s.homepage = %q{http://github.com/optimis/smilodon}
43
- s.licenses = ["MIT"]
44
- s.require_paths = ["lib"]
45
- s.rubygems_version = %q{1.6.2}
46
- s.summary = %q{Smilodon is a utility to parse data files.}
11
+ gem.files = `git ls-files`.split($\)
47
12
 
48
- if s.respond_to? :specification_version then
49
- s.specification_version = 3
13
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
14
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
50
15
 
51
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
52
- s.add_runtime_dependency(%q<logging>, [">= 0"])
53
- s.add_development_dependency(%q<jeweler>, ["~> 1.6.0"])
54
- s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
55
- s.add_development_dependency(%q<rspec>, ["~> 2.3.0"])
56
- s.add_development_dependency(%q<rcov>, [">= 0"])
57
- s.add_development_dependency(%q<yard>, ["~> 0.6.0"])
58
- else
59
- s.add_dependency(%q<logging>, [">= 0"])
60
- s.add_dependency(%q<jeweler>, ["~> 1.6.0"])
61
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
62
- s.add_dependency(%q<rspec>, ["~> 2.3.0"])
63
- s.add_dependency(%q<rcov>, [">= 0"])
64
- s.add_dependency(%q<yard>, ["~> 0.6.0"])
65
- end
66
- else
67
- s.add_dependency(%q<logging>, [">= 0"])
68
- s.add_dependency(%q<jeweler>, ["~> 1.6.0"])
69
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
70
- s.add_dependency(%q<rspec>, ["~> 2.3.0"])
71
- s.add_dependency(%q<rcov>, [">= 0"])
72
- s.add_dependency(%q<yard>, ["~> 0.6.0"])
73
- end
16
+ gem.name = 'smilodon'
17
+ gem.require_paths = [ 'lib', 'lib/smilodon' ]
18
+ gem.version = Smilodon::VERSION
74
19
  end
75
-
@@ -65,7 +65,7 @@ describe FakePopulator, '.files' do
65
65
 
66
66
  context 'given a directory and no files' do
67
67
  it 'sets files to all the files in directory' do
68
- FakePopulatorWithOnlyDirectory.files.should == ['bar', 'foo']
68
+ FakePopulatorWithOnlyDirectory.files.sort.should == ['bar', 'foo'].sort
69
69
  end
70
70
  end
71
71
  end
metadata CHANGED
@@ -1,129 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smilodon
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 2
9
- - 8
10
- version: 0.2.8
8
+ - 3
9
+ - 0
10
+ version: 0.3.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Umang Chouhan
14
+ - Hubert Huang
15
+ - Atsuya Takagi
14
16
  autorequire:
15
17
  bindir: bin
16
18
  cert_chain: []
17
19
 
18
- date: 2012-02-15 00:00:00 -08:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
22
- name: logging
23
- type: :runtime
24
- prerelease: false
25
- version_requirements: &id001 !ruby/object:Gem::Requirement
26
- none: false
27
- requirements:
28
- - - ">="
29
- - !ruby/object:Gem::Version
30
- hash: 3
31
- segments:
32
- - 0
33
- version: "0"
34
- requirement: *id001
35
- - !ruby/object:Gem::Dependency
36
- name: jeweler
37
- type: :development
38
- prerelease: false
39
- version_requirements: &id002 !ruby/object:Gem::Requirement
40
- none: false
41
- requirements:
42
- - - ~>
43
- - !ruby/object:Gem::Version
44
- hash: 15
45
- segments:
46
- - 1
47
- - 6
48
- - 0
49
- version: 1.6.0
50
- requirement: *id002
51
- - !ruby/object:Gem::Dependency
52
- name: bundler
53
- type: :development
54
- prerelease: false
55
- version_requirements: &id003 !ruby/object:Gem::Requirement
56
- none: false
57
- requirements:
58
- - - ~>
59
- - !ruby/object:Gem::Version
60
- hash: 23
61
- segments:
62
- - 1
63
- - 0
64
- - 0
65
- version: 1.0.0
66
- requirement: *id003
67
- - !ruby/object:Gem::Dependency
68
- name: rspec
69
- type: :development
70
- prerelease: false
71
- version_requirements: &id004 !ruby/object:Gem::Requirement
72
- none: false
73
- requirements:
74
- - - ~>
75
- - !ruby/object:Gem::Version
76
- hash: 3
77
- segments:
78
- - 2
79
- - 3
80
- - 0
81
- version: 2.3.0
82
- requirement: *id004
83
- - !ruby/object:Gem::Dependency
84
- name: rcov
85
- type: :development
86
- prerelease: false
87
- version_requirements: &id005 !ruby/object:Gem::Requirement
88
- none: false
89
- requirements:
90
- - - ">="
91
- - !ruby/object:Gem::Version
92
- hash: 3
93
- segments:
94
- - 0
95
- version: "0"
96
- requirement: *id005
97
- - !ruby/object:Gem::Dependency
98
- name: yard
99
- type: :development
100
- prerelease: false
101
- version_requirements: &id006 !ruby/object:Gem::Requirement
102
- none: false
103
- requirements:
104
- - - ~>
105
- - !ruby/object:Gem::Version
106
- hash: 7
107
- segments:
108
- - 0
109
- - 6
110
- - 0
111
- version: 0.6.0
112
- requirement: *id006
20
+ date: 2012-05-12 00:00:00 Z
21
+ dependencies: []
22
+
113
23
  description: Smilodon is a utility to parse data files.
114
- email: uchouhan@optimiscorp.com
24
+ email:
25
+ - uchouhan@optimiscorp.com
115
26
  executables: []
116
27
 
117
28
  extensions: []
118
29
 
119
- extra_rdoc_files:
120
- - LICENSE.txt
121
- - README.rdoc
30
+ extra_rdoc_files: []
31
+
122
32
  files:
123
33
  - .document
34
+ - .gitignore
124
35
  - .rspec
125
36
  - Gemfile
126
37
  - Gemfile.lock
38
+ - LICENSE
127
39
  - LICENSE.txt
128
40
  - README.rdoc
129
41
  - Rakefile
@@ -132,7 +44,9 @@ files:
132
44
  - lib/smilodon/errors.rb
133
45
  - lib/smilodon/fakes.rb
134
46
  - lib/smilodon/logger.rb
47
+ - lib/smilodon/railtie.rb
135
48
  - lib/smilodon/tasks.rb
49
+ - lib/smilodon/version.rb
136
50
  - lib/tasks/populate.rake
137
51
  - lib/tasks/populate.yml
138
52
  - smilodon.gemspec
@@ -141,15 +55,15 @@ files:
141
55
  - spec/spec_helper.rb
142
56
  - spec/test_files/bar.csv
143
57
  - spec/test_files/foo.csv
144
- has_rdoc: true
145
58
  homepage: http://github.com/optimis/smilodon
146
- licenses:
147
- - MIT
59
+ licenses: []
60
+
148
61
  post_install_message:
149
62
  rdoc_options: []
150
63
 
151
64
  require_paths:
152
65
  - lib
66
+ - lib/smilodon
153
67
  required_ruby_version: !ruby/object:Gem::Requirement
154
68
  none: false
155
69
  requirements:
@@ -171,9 +85,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
171
85
  requirements: []
172
86
 
173
87
  rubyforge_project:
174
- rubygems_version: 1.6.2
88
+ rubygems_version: 1.8.15
175
89
  signing_key:
176
90
  specification_version: 3
177
91
  summary: Smilodon is a utility to parse data files.
178
- test_files: []
179
-
92
+ test_files:
93
+ - spec/lib/smilodon_spec.rb
94
+ - spec/lib/tasks/populate_spec.rb
95
+ - spec/spec_helper.rb
96
+ - spec/test_files/bar.csv
97
+ - spec/test_files/foo.csv