r 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. data/Manifest +1 -0
  2. data/Rakefile +5 -3
  3. data/init.rb +2 -0
  4. data/lib/r.rb +38 -0
  5. data/r.gemspec +2 -2
  6. metadata +4 -3
data/Manifest CHANGED
@@ -1,5 +1,6 @@
1
1
  Manifest
2
2
  README
3
3
  Rakefile
4
+ init.rb
4
5
  lib/r.rb
5
6
  r.gemspec
data/Rakefile CHANGED
@@ -2,9 +2,9 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- #version = File.read( 'VERSION' ) rescue "0.0.42_bugged"
5
+ # Copied from RyanBates: http://railscasts.com/episodes/135-making-a-gem
6
6
 
7
- Echoe.new('r', '0.0.1' ) do |p|
7
+ Echoe.new('r', '0.0.2' ) do |p|
8
8
  p.description = "My second gem, and most minimalistic."
9
9
  p.url = "http://github.com/palladius/r"
10
10
  p.author = "Riccardo C."
@@ -18,4 +18,6 @@ Echoe.new('r', '0.0.1' ) do |p|
18
18
  "HISTORY"
19
19
  ]
20
20
  p.development_dependencies = [ ]
21
- end
21
+ end
22
+
23
+ Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
data/init.rb ADDED
@@ -0,0 +1,2 @@
1
+
2
+ require 'r'
data/lib/r.rb CHANGED
@@ -0,0 +1,38 @@
1
+
2
+ # lib/r.rb
3
+ module R
4
+ # def self.included(base)
5
+ # base.extend ClassMethods
6
+ # end
7
+ #
8
+ # def ensure_unique(name)
9
+ # begin
10
+ # self[name] = yield
11
+ # end while self.class.exists?(name => self[name])
12
+ # end
13
+ #
14
+ # module ClassMethods
15
+ #
16
+ # def uniquify(*args, &block)
17
+ # options = { :length => 8, :chars => ('a'..'z').to_a + ('A'..'Z').to_a + ('0'..'9').to_a }
18
+ # options.merge!(args.pop) if args.last.kind_of? Hash
19
+ # args.each do |name|
20
+ # before_create do |record|
21
+ # if block
22
+ # record.ensure_unique(name, &block)
23
+ # else
24
+ # record.ensure_unique(name) do
25
+ # Array.new(options[:length]) { options[:chars].to_a[rand(options[:chars].to_a.size)] }.join
26
+ # end
27
+ # end
28
+ # end
29
+ # end
30
+ # end
31
+ #
32
+ # end
33
+ end
34
+
35
+ class ActiveRecord::Base
36
+ include R
37
+ end
38
+
data/r.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{r}
5
- s.version = "0.0.1"
5
+ s.version = "0.0.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Riccardo C."]
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.description = %q{My second gem, and most minimalistic.}
11
11
  s.email = %q{['p','ll','diusbonton@gm','il.com'].join('a')}
12
12
  s.extra_rdoc_files = ["README", "lib/r.rb"]
13
- s.files = ["Manifest", "README", "Rakefile", "lib/r.rb", "r.gemspec"]
13
+ s.files = ["Manifest", "README", "Rakefile", "init.rb", "lib/r.rb", "r.gemspec"]
14
14
  s.homepage = %q{http://github.com/palladius/r}
15
15
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "R", "--main", "README"]
16
16
  s.require_paths = ["lib"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: r
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Riccardo C.
@@ -32,6 +32,7 @@ files:
32
32
  - Manifest
33
33
  - README
34
34
  - Rakefile
35
+ - init.rb
35
36
  - lib/r.rb
36
37
  - r.gemspec
37
38
  has_rdoc: true