jsfrost_test_gem 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/bin/test_gem CHANGED
@@ -1,4 +1,21 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+ require 'test_gem'
4
+
3
5
  puts "test_gem script executing"
4
- puts ARGV[0]
6
+ puts ARGV[0]
7
+
8
+ print "Working with file: "
9
+ puts ARGV[0]
10
+
11
+ returnVal = TestGem::File.first ARGV[0]
12
+
13
+ print "The chomped first line of that file is: "
14
+ puts returnVal
15
+
16
+ returnVal2 = TestGem::File.last ARGV[0]
17
+
18
+ print "The chomped last line of that file is: "
19
+ puts returnVal2
20
+
21
+ puts "Bye bye, from test_gem"
@@ -0,0 +1,27 @@
1
+ module TestGem
2
+
3
+ class File
4
+ puts "class #{self} defined"
5
+
6
+ def File.first fileName
7
+ results = []
8
+ open(fileName).each do |line|
9
+ results << line
10
+ end
11
+ p "The file has #{results.size} lines."
12
+ p "The first line is: #{results.first}."
13
+ results.first.chomp
14
+ end
15
+
16
+ def File.last fileName
17
+ results = []
18
+ open(fileName).each do |line|
19
+ results << line
20
+ end
21
+ p "The file has #{results.size} lines."
22
+ p "The last line is: #{results.last}."
23
+ results.last.chomp
24
+ end
25
+ end
26
+
27
+ end
@@ -2,6 +2,6 @@ module TestGem
2
2
 
3
3
  puts "file version.rb required"
4
4
 
5
- VERSION = "0.0.1"
5
+ VERSION = "0.0.2"
6
6
 
7
- end
7
+ end
data/lib/test_gem.rb CHANGED
@@ -2,9 +2,10 @@ $LOAD_PATH.unshift File.expand_path("../test_gem", __FILE__)
2
2
 
3
3
  require 'version'
4
4
  require 'hello'
5
+ require 'file'
5
6
 
6
7
  module TestGem
7
8
 
8
9
  puts "module TestGem defined"
9
10
 
10
- end
11
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsfrost_test_gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -21,6 +21,7 @@ files:
21
21
  - lib/test_gem.rb
22
22
  - lib/test_gem/version.rb
23
23
  - lib/test_gem/hello.rb
24
+ - lib/test_gem/file.rb
24
25
  - !binary |-
25
26
  YmluL3Rlc3RfZ2Vt
26
27
  homepage: http://rubygems.org/gems/test_gem