paladin 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Binary file
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
data/Gemfile CHANGED
@@ -1,4 +1,13 @@
1
- source 'https://rubygems.org'
1
+ source "http://rubygems.org"
2
+ # Add dependencies required to use your gem here.
3
+ # Example:
4
+ # gem "activesupport", ">= 2.3.5"
2
5
 
3
- # Specify your gem's dependencies in paladin.gemspec
4
- gemspec
6
+ # Add dependencies to develop your gem here.
7
+ # Include everything needed to run rake, tests, features, etc.
8
+ group :development do
9
+ gem "rspec"
10
+ gem "rdoc"
11
+ gem "bundler"
12
+ gem "jeweler"
13
+ end
@@ -0,0 +1,31 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ diff-lcs (1.1.3)
5
+ git (1.2.5)
6
+ jeweler (1.8.4)
7
+ bundler (~> 1.0)
8
+ git (>= 1.2.5)
9
+ rake
10
+ rdoc
11
+ json (1.7.5)
12
+ rake (10.0.2)
13
+ rdoc (3.12)
14
+ json (~> 1.4)
15
+ rspec (2.12.0)
16
+ rspec-core (~> 2.12.0)
17
+ rspec-expectations (~> 2.12.0)
18
+ rspec-mocks (~> 2.12.0)
19
+ rspec-core (2.12.1)
20
+ rspec-expectations (2.12.0)
21
+ diff-lcs (~> 1.1.3)
22
+ rspec-mocks (2.12.0)
23
+
24
+ PLATFORMS
25
+ ruby
26
+
27
+ DEPENDENCIES
28
+ bundler
29
+ jeweler
30
+ rdoc
31
+ rspec
@@ -1,7 +1,5 @@
1
1
  Copyright (c) 2012 Kelli Mohr
2
2
 
3
- MIT License
4
-
5
3
  Permission is hereby granted, free of charge, to any person obtaining
6
4
  a copy of this software and associated documentation files (the
7
5
  "Software"), to deal in the Software without restriction, including
@@ -19,4 +17,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
17
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
18
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
19
  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.
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,19 @@
1
+ = paladin
2
+
3
+ Description goes here.
4
+
5
+ == Contributing to paladin
6
+
7
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
8
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
9
+ * Fork the project.
10
+ * Start a feature/bugfix branch.
11
+ * Commit and push until you are happy with your contribution.
12
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
+
15
+ == Copyright
16
+
17
+ Copyright (c) 2012 Kelli Mohr. See LICENSE.txt for
18
+ further details.
19
+
data/Rakefile CHANGED
@@ -1 +1,49 @@
1
- require "bundler/gem_tasks"
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 = "paladin"
18
+ gem.homepage = "http://github.com/kmohr/paladin"
19
+ gem.license = "MIT"
20
+ gem.summary = "File Checker for Builds"
21
+ gem.description = "Checks if files exist."
22
+ gem.email = "kmohr@fulcrum.net"
23
+ gem.authors = ["Kelli Mohr"]
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 'rdoc/task'
42
+ Rake::RDocTask.new do |rdoc|
43
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
44
+
45
+ rdoc.rdoc_dir = 'rdoc'
46
+ rdoc.title = "paladin #{version}"
47
+ rdoc.rdoc_files.include('README*')
48
+ rdoc.rdoc_files.include('lib/**/*.rb')
49
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.2
@@ -0,0 +1,4 @@
1
+ spec_helper.rb
2
+ kelli.txt
3
+ paladin_spec.rb
4
+ /Users/kellimohr/Gems/paladin/README.rdoc
@@ -0,0 +1,6 @@
1
+ Missing Files:
2
+ spec_helper.rb
3
+ kelli.txt
4
+ paladin_spec.rb
5
+ Total Files Verified: 5
6
+ Total Files Missing: 3
@@ -1,5 +1,29 @@
1
- require "paladin/version"
1
+ # Paladin class verifies if files exist and writes missing files to
2
+ # the paladin.log file.
3
+ class Paladin
2
4
 
3
- module Paladin
4
- # Your code goes here...
5
+ #Paladin takes a default file file_spec.txt in the same directory
6
+ def self.load_file
7
+ @file_name = "file_spec.txt"
8
+ @counter = 1
9
+ @missed = 0
10
+
11
+ @log = File.open("paladin.log", 'w')
12
+ end
13
+
14
+ #Write missing files to paladin.log
15
+ def self.verify_files
16
+
17
+ @log.write("Missing Files: \n")
18
+ File.open(@file_name).each do |value|
19
+ value.chomp!
20
+
21
+ unless File.exist?(value)
22
+ @log.write("#{value}\n")
23
+ @missed+=1
24
+ end
25
+ @counter+=1
26
+ end
27
+ @log.write("Total Files Verified: #{@counter}\n Total Files Missing: #{@missed}\n")
28
+ end
5
29
  end
@@ -0,0 +1,4 @@
1
+ spec_helper.rb
2
+ kelli.txt
3
+ paladin_spec.rb
4
+ /Users/kellimohr/Gems/paladin/README.rdoc
File without changes
@@ -0,0 +1,20 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe "Paladin" do
4
+
5
+ before :each do
6
+ @file = Paladin.new
7
+ end
8
+
9
+ it "should open the file and verify a file path exists" do
10
+ @file.should be_an_instance_of Paladin
11
+ end
12
+
13
+ it "should accept and read a file" do
14
+ @verify_files.should be_nil
15
+ end
16
+
17
+ it "should create paladin.log" do
18
+ File.exists?("@file.missing_files") == true
19
+ end
20
+ end
@@ -0,0 +1,12 @@
1
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
3
+ require 'rspec'
4
+ require 'paladin'
5
+
6
+ # Requires supporting files with custom matchers and macros, etc,
7
+ # in ./support/ and its subdirectories.
8
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
9
+
10
+ RSpec.configure do |config|
11
+
12
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 1
9
- version: 0.0.1
8
+ - 2
9
+ version: 0.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Kelli Mohr
@@ -16,30 +16,85 @@ cert_chain: []
16
16
 
17
17
  date: 2012-12-09 00:00:00 -08:00
18
18
  default_executable:
19
- dependencies: []
20
-
21
- description: Paladin reads a file with a list of files and verifies if the files exist
22
- email:
23
- - kmohr@fulcrum.net
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ prerelease: false
22
+ type: :development
23
+ name: rspec
24
+ version_requirements: &id001 !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ segments:
29
+ - 0
30
+ version: "0"
31
+ requirement: *id001
32
+ - !ruby/object:Gem::Dependency
33
+ prerelease: false
34
+ type: :development
35
+ name: rdoc
36
+ version_requirements: &id002 !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ segments:
41
+ - 0
42
+ version: "0"
43
+ requirement: *id002
44
+ - !ruby/object:Gem::Dependency
45
+ prerelease: false
46
+ type: :development
47
+ name: bundler
48
+ version_requirements: &id003 !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ segments:
53
+ - 0
54
+ version: "0"
55
+ requirement: *id003
56
+ - !ruby/object:Gem::Dependency
57
+ prerelease: false
58
+ type: :development
59
+ name: jeweler
60
+ version_requirements: &id004 !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ segments:
65
+ - 0
66
+ version: "0"
67
+ requirement: *id004
68
+ description: Checks if files exist.
69
+ email: kmohr@fulcrum.net
24
70
  executables: []
25
71
 
26
72
  extensions: []
27
73
 
28
- extra_rdoc_files: []
29
-
74
+ extra_rdoc_files:
75
+ - LICENSE.txt
76
+ - README.rdoc
30
77
  files:
31
- - .gitignore
78
+ - .DS_Store
79
+ - .document
80
+ - .rspec
32
81
  - Gemfile
82
+ - Gemfile.lock
33
83
  - LICENSE.txt
34
- - README.md
84
+ - README.rdoc
35
85
  - Rakefile
86
+ - VERSION
87
+ - lib/file_spec.txt
88
+ - lib/paladin.log
36
89
  - lib/paladin.rb
37
- - lib/paladin/version.rb
38
- - paladin.gemspec
90
+ - spec/file_spec.txt
91
+ - spec/paladin.log
92
+ - spec/paladin_spec.rb
93
+ - spec/spec_helper.rb
39
94
  has_rdoc: true
40
- homepage: ""
41
- licenses: []
42
-
95
+ homepage: http://github.com/kmohr/paladin
96
+ licenses:
97
+ - MIT
43
98
  post_install_message:
44
99
  rdoc_options: []
45
100
 
@@ -65,6 +120,6 @@ rubyforge_project:
65
120
  rubygems_version: 1.3.6
66
121
  signing_key:
67
122
  specification_version: 3
68
- summary: File verification Gem
123
+ summary: File Checker for Builds
69
124
  test_files: []
70
125
 
data/.gitignore DELETED
@@ -1,17 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- test/tmp
16
- test/version_tmp
17
- tmp
data/README.md DELETED
@@ -1,29 +0,0 @@
1
- # Paladin
2
-
3
- TODO: Write a gem description
4
-
5
- ## Installation
6
-
7
- Add this line to your application's Gemfile:
8
-
9
- gem 'paladin'
10
-
11
- And then execute:
12
-
13
- $ bundle
14
-
15
- Or install it yourself as:
16
-
17
- $ gem install paladin
18
-
19
- ## Usage
20
-
21
- TODO: Write usage instructions here
22
-
23
- ## Contributing
24
-
25
- 1. Fork it
26
- 2. Create your feature branch (`git checkout -b my-new-feature`)
27
- 3. Commit your changes (`git commit -am 'Add some feature'`)
28
- 4. Push to the branch (`git push origin my-new-feature`)
29
- 5. Create new Pull Request
@@ -1,3 +0,0 @@
1
- module Paladin
2
- VERSION = "0.0.1"
3
- end
@@ -1,19 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'paladin/version'
5
-
6
- Gem::Specification.new do |gem|
7
- gem.name = "paladin"
8
- gem.version = Paladin::VERSION
9
- gem.authors = ["Kelli Mohr"]
10
- gem.email = ["kmohr@fulcrum.net"]
11
- gem.description = "Paladin reads a file with a list of files and verifies if the files exist"
12
- gem.summary = "File verification Gem"
13
- gem.homepage = ""
14
-
15
- gem.files = `git ls-files`.split($/)
16
- gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
- gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
- gem.require_paths = ["lib"]
19
- end