transient 1.1.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +2 -1
- data/.rspec +4 -0
- data/.rvmrc +2 -0
- data/Gemfile +4 -0
- data/Guardfile +7 -0
- data/README.rdoc +4 -5
- data/Rakefile +1 -47
- data/lib/date_time_extensions.rb +7 -1
- data/lib/transient.rb +9 -5
- data/lib/transient/active_record_extensions.rb +4 -5
- data/lib/transient/railtie.rb +15 -0
- data/lib/transient/version.rb +3 -0
- data/spec/{single_active_transient_shared_spec.rb → single_active_transient_sharedspec.rb} +4 -2
- data/spec/spec_helper.rb +7 -8
- data/spec/{transient_shared_spec.rb → transient_sharedspec.rb} +7 -5
- data/spec/transient_spec.rb +30 -9
- data/transient.gemspec +24 -66
- metadata +129 -44
- data/History.txt +0 -16
- data/VERSION +0 -1
- data/script/console +0 -11
- data/spec/spec.opts +0 -1
data/.gitignore
CHANGED
data/.rspec
ADDED
data/.rvmrc
ADDED
data/Gemfile
ADDED
data/Guardfile
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
guard 'rspec', :version => 2, :all_on_start => true, :all_after_pass => true, :cli => '--debugger --color --format doc' do
|
4
|
+
watch( %r{^spec/.+_spec\.rb$} )
|
5
|
+
watch( %r{^lib/(.+)\.rb$} ) { |m| "spec/#{m[1]}_spec.rb" }
|
6
|
+
watch( 'spec/spec_helper.rb' ) { "spec" }
|
7
|
+
end
|
data/README.rdoc
CHANGED
@@ -20,8 +20,7 @@ Provides an API for making any ActiveRecord object transient.
|
|
20
20
|
|
21
21
|
== REQUIREMENTS
|
22
22
|
|
23
|
-
*
|
24
|
-
* ActiveSupport >= 2.3
|
23
|
+
* Rails >= 3.0.0
|
25
24
|
|
26
25
|
|
27
26
|
== INSTALL
|
@@ -32,13 +31,13 @@ Provides an API for making any ActiveRecord object transient.
|
|
32
31
|
|
33
32
|
== INSTALL FOR RAILS
|
34
33
|
|
35
|
-
Add to
|
34
|
+
Add to Gemfile:
|
36
35
|
|
37
|
-
|
36
|
+
gem "transient"
|
38
37
|
|
39
38
|
Run:
|
40
39
|
|
41
|
-
|
40
|
+
bundle install
|
42
41
|
|
43
42
|
|
44
43
|
== USAGE
|
data/Rakefile
CHANGED
@@ -1,47 +1 @@
|
|
1
|
-
require
|
2
|
-
require 'rake'
|
3
|
-
|
4
|
-
begin
|
5
|
-
require 'jeweler'
|
6
|
-
Jeweler::Tasks.new do |gem|
|
7
|
-
gem.name = "transient"
|
8
|
-
gem.summary = %Q{Provides an API for making any ActiveRecord object transient.}
|
9
|
-
gem.description = %Q{Provides an API for making any ActiveRecord object transient. In addition, provides functionality for models where only a single instance of the model can be current at one time.}
|
10
|
-
gem.email = "jason@lookforwardenterprises.com"
|
11
|
-
gem.homepage = "http://github.com/midas/transient"
|
12
|
-
gem.authors = ["C. Jason Harrelson (midas)"]
|
13
|
-
gem.add_dependency "activerecord", ">= 2.3"
|
14
|
-
gem.add_dependency "activesupport", ">= 2.3"
|
15
|
-
gem.add_development_dependency "rspec", ">= 1.2.9"
|
16
|
-
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
17
|
-
end
|
18
|
-
Jeweler::GemcutterTasks.new
|
19
|
-
rescue LoadError
|
20
|
-
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
21
|
-
end
|
22
|
-
|
23
|
-
require 'spec/rake/spectask'
|
24
|
-
Spec::Rake::SpecTask.new(:spec) do |spec|
|
25
|
-
spec.libs << 'lib' << 'spec'
|
26
|
-
spec.spec_files = FileList['spec/**/*_spec.rb']
|
27
|
-
end
|
28
|
-
|
29
|
-
Spec::Rake::SpecTask.new(:rcov) do |spec|
|
30
|
-
spec.libs << 'lib' << 'spec'
|
31
|
-
spec.pattern = 'spec/**/*_spec.rb'
|
32
|
-
spec.rcov = true
|
33
|
-
end
|
34
|
-
|
35
|
-
task :spec => :check_dependencies
|
36
|
-
|
37
|
-
task :default => :spec
|
38
|
-
|
39
|
-
require 'rake/rdoctask'
|
40
|
-
Rake::RDocTask.new do |rdoc|
|
41
|
-
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
42
|
-
|
43
|
-
rdoc.rdoc_dir = 'rdoc'
|
44
|
-
rdoc.title = "transient #{version}"
|
45
|
-
rdoc.rdoc_files.include('README*')
|
46
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
47
|
-
end
|
1
|
+
require "bundler/gem_tasks"
|
data/lib/date_time_extensions.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
class DateTime
|
2
|
+
|
2
3
|
def self.beginning_of
|
3
4
|
DateTime.parse( "0000-01-01T00:00:00+00:00" )
|
4
5
|
end
|
@@ -14,9 +15,11 @@ class DateTime
|
|
14
15
|
def to_standard_s
|
15
16
|
return time? ? strftime( "%B %d, %Y %I:%M %p" ) : to_date.to_standard_s
|
16
17
|
end
|
18
|
+
|
17
19
|
end
|
18
20
|
|
19
21
|
class Date
|
22
|
+
|
20
23
|
def self.beginning_of
|
21
24
|
DateTime.beginning_of.to_date
|
22
25
|
end
|
@@ -32,9 +35,11 @@ class Date
|
|
32
35
|
def to_standard_s
|
33
36
|
strftime( "%B %d, %Y" )
|
34
37
|
end
|
38
|
+
|
35
39
|
end
|
36
40
|
|
37
41
|
class Time
|
42
|
+
|
38
43
|
def time?
|
39
44
|
return !(hour == 0 && min == 0 && sec == 0)
|
40
45
|
end
|
@@ -42,4 +47,5 @@ class Time
|
|
42
47
|
def to_standard_s
|
43
48
|
return time? ? to_datetime.to_standard_s : to_date.to_standard_s
|
44
49
|
end
|
45
|
-
|
50
|
+
|
51
|
+
end
|
data/lib/transient.rb
CHANGED
@@ -1,10 +1,14 @@
|
|
1
|
-
$:.unshift(File.dirname(__FILE__)) unless
|
2
|
-
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
|
3
1
|
require 'date_time_extensions'
|
4
|
-
require 'transient/active_record_extensions'
|
5
2
|
|
6
3
|
module Transient
|
7
|
-
|
4
|
+
|
5
|
+
autoload :ActiveRecordExtensions, 'transient/active_record_extensions'
|
6
|
+
autoload :Version, 'transient/version'
|
7
|
+
|
8
8
|
end
|
9
9
|
|
10
|
-
|
10
|
+
begin
|
11
|
+
require 'transient/railtie' if /3\.\d+\.\d+/.match( Rails.version )
|
12
|
+
rescue
|
13
|
+
ActiveRecord::Base.send( :include, Transient::ActiveRecordExtensions ) if defined?( ActiveRecord::Base )
|
14
|
+
end
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require File.expand_path( File.dirname(__FILE__) ) + '/../date_time_extensions'
|
2
|
-
|
3
1
|
module Transient
|
4
2
|
module ActiveRecordExtensions
|
5
3
|
def self.included( base ) #:nodoc:
|
@@ -14,7 +12,7 @@ module Transient
|
|
14
12
|
#options.merge!( :check_exists => false ) unless options[:check_exists]
|
15
13
|
if options[:single_active] != false
|
16
14
|
include SingleActive unless included_modules.include?( SingleActive )
|
17
|
-
|
15
|
+
class_attribute :transient_options
|
18
16
|
self.transient_options = options
|
19
17
|
end
|
20
18
|
end
|
@@ -58,7 +56,7 @@ module Transient
|
|
58
56
|
# Validates this record's effective dates occur in correct sequence (ie. effective_at is before
|
59
57
|
# expiring_at).
|
60
58
|
#
|
61
|
-
def
|
59
|
+
def effective_at_earlier_than_expiring_at
|
62
60
|
return unless self.effective_at && self.expiring_at
|
63
61
|
|
64
62
|
unless self.effective_at.to_datetime <= self.expires_at.to_datetime
|
@@ -67,6 +65,7 @@ module Transient
|
|
67
65
|
|
68
66
|
super unless self.class.is_active_record_3?
|
69
67
|
end
|
68
|
+
base.validate :effective_at_earlier_than_expiring_at
|
70
69
|
|
71
70
|
# The date this record expires. Returns DateTime.end_of for records that have a
|
72
71
|
# nil value in the database.
|
@@ -158,4 +157,4 @@ module Transient
|
|
158
157
|
end
|
159
158
|
end
|
160
159
|
end
|
161
|
-
end
|
160
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'rails'
|
2
|
+
|
3
|
+
module Transient
|
4
|
+
|
5
|
+
class Railtie < ::Rails::Railtie
|
6
|
+
|
7
|
+
initializer "transient.insert_into_active_record" do
|
8
|
+
ActiveSupport.on_load :active_record do
|
9
|
+
ActiveRecord::Base.send :include, Transient::ActiveRecordExtensions
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
@@ -1,6 +1,7 @@
|
|
1
|
-
require
|
1
|
+
require 'spec_helper'
|
2
2
|
|
3
3
|
shared_examples_for "Any transient that is single active" do
|
4
|
+
|
4
5
|
it "should agree that the InstanceMethods module is included" do
|
5
6
|
@klass.included_modules.include?( Transient::ActiveRecordExtensions::InstanceMethods ).should be_true
|
6
7
|
end
|
@@ -8,4 +9,5 @@ shared_examples_for "Any transient that is single active" do
|
|
8
9
|
it "should agree that the SingleActive module is included" do
|
9
10
|
@klass.included_modules.include?( Transient::ActiveRecordExtensions::SingleActive ).should be_true
|
10
11
|
end
|
11
|
-
|
12
|
+
|
13
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,13 +1,12 @@
|
|
1
|
-
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
2
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
3
1
|
require 'rubygems'
|
4
2
|
require 'active_record'
|
3
|
+
require 'bundler/setup'
|
5
4
|
require 'transient'
|
6
|
-
require 'spec'
|
7
|
-
require 'spec/autorun'
|
8
5
|
|
9
|
-
|
10
|
-
|
6
|
+
RSpec.configure do |config|
|
7
|
+
|
8
|
+
config.mock_with :rspec
|
9
|
+
|
11
10
|
end
|
12
11
|
|
13
12
|
ActiveRecord::Base.configurations = YAML::load( IO.read( File.dirname(__FILE__) + '/database.yml' ) )
|
@@ -26,7 +25,7 @@ ActiveRecord::Schema.define :version => 1 do
|
|
26
25
|
t.datetime :effective_at
|
27
26
|
t.datetime :expiring_at
|
28
27
|
end
|
29
|
-
|
28
|
+
|
30
29
|
create_table :addresses, :force => true do |t|
|
31
30
|
t.string :street, :limit => 75
|
32
31
|
t.string :location, :limit => 20
|
@@ -45,4 +44,4 @@ end
|
|
45
44
|
|
46
45
|
class Address < ActiveRecord::Base
|
47
46
|
acts_as_transient :single_active => %w(location), :check_exists => %w(street location)
|
48
|
-
end
|
47
|
+
end
|
@@ -1,6 +1,7 @@
|
|
1
|
-
require
|
1
|
+
require 'spec_helper'
|
2
2
|
|
3
3
|
shared_examples_for "Any transient" do
|
4
|
+
|
4
5
|
it "should be Transient" do
|
5
6
|
@instance.should respond_to(:effective_at)
|
6
7
|
@instance.should respond_to(:expiring_at)
|
@@ -54,7 +55,7 @@ shared_examples_for "Any transient" do
|
|
54
55
|
@instance.should_not be_past
|
55
56
|
@instance.should be_future
|
56
57
|
end
|
57
|
-
|
58
|
+
|
58
59
|
it "should respond to :effective" do
|
59
60
|
@klass.respond_to?( :effective ).should be_true
|
60
61
|
end
|
@@ -64,13 +65,14 @@ shared_examples_for "Any transient" do
|
|
64
65
|
@instance.should_receive(:after_expire!)
|
65
66
|
@instance.expire!
|
66
67
|
end
|
67
|
-
|
68
|
+
|
68
69
|
it "should set effective_at to now if it was not explicitly set to something else" do
|
69
70
|
@instance_no_dates.effective_at.should_not be_nil
|
70
71
|
end
|
71
|
-
|
72
|
+
|
72
73
|
it "should not allow records without an effective_at date to be saved" do
|
73
74
|
@instance_no_dates.effective_at = nil
|
74
75
|
@instance_no_dates.save.should be_false
|
75
76
|
end
|
76
|
-
|
77
|
+
|
78
|
+
end
|
data/spec/transient_spec.rb
CHANGED
@@ -1,17 +1,31 @@
|
|
1
|
-
require
|
2
|
-
require File.expand_path(File.dirname(__FILE__) + '/
|
3
|
-
require File.expand_path(File.dirname(__FILE__) + '/
|
1
|
+
require 'spec_helper'
|
2
|
+
require File.expand_path(File.dirname(__FILE__) + '/transient_sharedspec')
|
3
|
+
require File.expand_path(File.dirname(__FILE__) + '/single_active_transient_sharedspec')
|
4
|
+
|
5
|
+
describe Transient do
|
6
|
+
|
7
|
+
before :each do
|
8
|
+
zone.stub!( :now ).and_return Time.now
|
9
|
+
Time.stub!( :zone ).and_return zone
|
10
|
+
end
|
11
|
+
|
12
|
+
let :zone do
|
13
|
+
mock :zone
|
14
|
+
end
|
4
15
|
|
5
|
-
describe "Transient" do
|
6
16
|
describe "having ActiveRecord extensions" do
|
17
|
+
|
7
18
|
it "should respond to phone_number" do
|
8
19
|
ActiveRecord::Base.respond_to?( :acts_as_transient ).should be_true
|
9
20
|
end
|
21
|
+
|
10
22
|
end
|
11
23
|
|
12
24
|
describe "having models descending from ActiveRecord" do
|
25
|
+
|
13
26
|
describe "that are not single active" do
|
14
|
-
|
27
|
+
|
28
|
+
before :each do
|
15
29
|
@klass = User
|
16
30
|
@instance = @klass.create( :name => 'John Smith', :effective_at => (DateTime.now - 1.days), :expiring_at => DateTime.end_of )
|
17
31
|
@instance_no_dates = @klass.create( :name => 'Jack Smith' )
|
@@ -26,26 +40,30 @@ describe "Transient" do
|
|
26
40
|
it "should agree that the SingleActive module is not included" do
|
27
41
|
User.included_modules.include?( Transient::ActiveRecordExtensions::SingleActive ).should be_false
|
28
42
|
end
|
43
|
+
|
29
44
|
end
|
30
45
|
|
31
46
|
describe "that are single active" do
|
32
|
-
|
47
|
+
|
48
|
+
before :each do
|
33
49
|
@klass = ContactNumber
|
34
50
|
@instance = @klass.create( :number => '012345678901', :location => 'home', :effective_at => (DateTime.now - 1.days) )
|
35
51
|
@instance_no_dates = @klass.create( :number => '012345678901', :location => 'home' )
|
36
52
|
end
|
37
53
|
|
38
54
|
it_should_behave_like "Any transient"
|
39
|
-
it_should_behave_like "Any transient that is single active"
|
55
|
+
it_should_behave_like "Any transient that is single active"
|
40
56
|
|
41
57
|
it "should expire the current active before saving a new one" do
|
42
58
|
@new_contact = ContactNumber.create( :number => '019876543210', :location => 'home', :effective_at => DateTime.now )
|
43
59
|
@instance.reload
|
44
60
|
@instance.expired?.should be_true
|
45
61
|
end
|
62
|
+
|
46
63
|
end
|
47
|
-
|
64
|
+
|
48
65
|
describe "that are single active with check exists" do
|
66
|
+
|
49
67
|
before :each do
|
50
68
|
@klass = Address
|
51
69
|
@instance = @klass.create( :street => '26 street', :location => 'home', :effective_at => (DateTime.now - 1.days) )
|
@@ -60,6 +78,9 @@ describe "Transient" do
|
|
60
78
|
@instance.reload
|
61
79
|
@instance.expired?.should be_true
|
62
80
|
end
|
81
|
+
|
63
82
|
end
|
83
|
+
|
64
84
|
end
|
65
|
-
|
85
|
+
|
86
|
+
end
|
data/transient.gemspec
CHANGED
@@ -1,74 +1,32 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "transient/version"
|
5
4
|
|
6
5
|
Gem::Specification.new do |s|
|
7
|
-
s.name
|
8
|
-
s.version
|
6
|
+
s.name = "transient"
|
7
|
+
s.version = Transient::VERSION
|
8
|
+
s.authors = ["C. Jason Harrelson (midas)"]
|
9
|
+
s.email = ["jason@lookforwardenterprises.com"]
|
10
|
+
s.homepage = "https://github.com/midas/transient"
|
11
|
+
s.summary = %q{}
|
12
|
+
s.description = %q{Provides an API for making any ActiveRecord object transient.}
|
9
13
|
|
10
|
-
s.
|
11
|
-
|
12
|
-
s.
|
13
|
-
s.
|
14
|
-
s.
|
15
|
-
s.extra_rdoc_files = [
|
16
|
-
"LICENSE",
|
17
|
-
"README.rdoc"
|
18
|
-
]
|
19
|
-
s.files = [
|
20
|
-
".document",
|
21
|
-
".gitignore",
|
22
|
-
"History.txt",
|
23
|
-
"LICENSE",
|
24
|
-
"README.rdoc",
|
25
|
-
"Rakefile",
|
26
|
-
"VERSION",
|
27
|
-
"lib/date_time_extensions.rb",
|
28
|
-
"lib/transient.rb",
|
29
|
-
"lib/transient/active_record_extensions.rb",
|
30
|
-
"script/console",
|
31
|
-
"spec/database.yml",
|
32
|
-
"spec/date_time_extensions_spec.rb",
|
33
|
-
"spec/single_active_transient_shared_spec.rb",
|
34
|
-
"spec/spec.opts",
|
35
|
-
"spec/spec_helper.rb",
|
36
|
-
"spec/transient/active_record_extensions_spec.rb",
|
37
|
-
"spec/transient_shared_spec.rb",
|
38
|
-
"spec/transient_spec.rb",
|
39
|
-
"transient.gemspec"
|
40
|
-
]
|
41
|
-
s.homepage = %q{http://github.com/midas/transient}
|
42
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
14
|
+
s.rubyforge_project = "transient"
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
43
19
|
s.require_paths = ["lib"]
|
44
|
-
s.rubygems_version = %q{1.3.7}
|
45
|
-
s.summary = %q{Provides an API for making any ActiveRecord object transient.}
|
46
|
-
s.test_files = [
|
47
|
-
"spec/date_time_extensions_spec.rb",
|
48
|
-
"spec/single_active_transient_shared_spec.rb",
|
49
|
-
"spec/spec_helper.rb",
|
50
|
-
"spec/transient/active_record_extensions_spec.rb",
|
51
|
-
"spec/transient_shared_spec.rb",
|
52
|
-
"spec/transient_spec.rb"
|
53
|
-
]
|
54
20
|
|
55
|
-
|
56
|
-
|
57
|
-
|
21
|
+
# specify any dependencies here; for example:
|
22
|
+
s.add_development_dependency "rspec"
|
23
|
+
s.add_development_dependency "rails", ">= 3.0.0"
|
24
|
+
s.add_development_dependency "ruby-debug"
|
25
|
+
s.add_development_dependency "sqlite3"
|
26
|
+
s.add_development_dependency "guard"
|
27
|
+
s.add_development_dependency 'rb-fsevent'
|
28
|
+
s.add_development_dependency 'growl'
|
29
|
+
s.add_development_dependency 'guard-rspec'
|
58
30
|
|
59
|
-
|
60
|
-
s.add_runtime_dependency(%q<activerecord>, [">= 2.3"])
|
61
|
-
s.add_runtime_dependency(%q<activesupport>, [">= 2.3"])
|
62
|
-
s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
|
63
|
-
else
|
64
|
-
s.add_dependency(%q<activerecord>, [">= 2.3"])
|
65
|
-
s.add_dependency(%q<activesupport>, [">= 2.3"])
|
66
|
-
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
67
|
-
end
|
68
|
-
else
|
69
|
-
s.add_dependency(%q<activerecord>, [">= 2.3"])
|
70
|
-
s.add_dependency(%q<activesupport>, [">= 2.3"])
|
71
|
-
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
72
|
-
end
|
31
|
+
s.add_runtime_dependency "rails", ">= 3.0.0"
|
73
32
|
end
|
74
|
-
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: transient
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 15
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
|
-
-
|
8
|
-
-
|
7
|
+
- 2
|
8
|
+
- 0
|
9
9
|
- 0
|
10
|
-
version:
|
10
|
+
version: 2.0.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- C. Jason Harrelson (midas)
|
@@ -15,92 +15,176 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
19
|
-
default_executable:
|
18
|
+
date: 2012-02-13 00:00:00 Z
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
|
-
name:
|
21
|
+
name: rspec
|
23
22
|
prerelease: false
|
24
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
24
|
none: false
|
26
25
|
requirements:
|
27
26
|
- - ">="
|
28
27
|
- !ruby/object:Gem::Version
|
29
|
-
hash:
|
28
|
+
hash: 3
|
30
29
|
segments:
|
31
|
-
-
|
32
|
-
|
33
|
-
|
34
|
-
type: :runtime
|
30
|
+
- 0
|
31
|
+
version: "0"
|
32
|
+
type: :development
|
35
33
|
version_requirements: *id001
|
36
34
|
- !ruby/object:Gem::Dependency
|
37
|
-
name:
|
35
|
+
name: rails
|
38
36
|
prerelease: false
|
39
37
|
requirement: &id002 !ruby/object:Gem::Requirement
|
40
38
|
none: false
|
41
39
|
requirements:
|
42
40
|
- - ">="
|
43
41
|
- !ruby/object:Gem::Version
|
44
|
-
hash:
|
42
|
+
hash: 7
|
45
43
|
segments:
|
46
|
-
- 2
|
47
44
|
- 3
|
48
|
-
|
49
|
-
|
45
|
+
- 0
|
46
|
+
- 0
|
47
|
+
version: 3.0.0
|
48
|
+
type: :development
|
50
49
|
version_requirements: *id002
|
51
50
|
- !ruby/object:Gem::Dependency
|
52
|
-
name:
|
51
|
+
name: ruby-debug
|
53
52
|
prerelease: false
|
54
53
|
requirement: &id003 !ruby/object:Gem::Requirement
|
55
54
|
none: false
|
56
55
|
requirements:
|
57
56
|
- - ">="
|
58
57
|
- !ruby/object:Gem::Version
|
59
|
-
hash:
|
58
|
+
hash: 3
|
60
59
|
segments:
|
61
|
-
-
|
62
|
-
|
63
|
-
- 9
|
64
|
-
version: 1.2.9
|
60
|
+
- 0
|
61
|
+
version: "0"
|
65
62
|
type: :development
|
66
63
|
version_requirements: *id003
|
67
|
-
|
68
|
-
|
64
|
+
- !ruby/object:Gem::Dependency
|
65
|
+
name: sqlite3
|
66
|
+
prerelease: false
|
67
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
68
|
+
none: false
|
69
|
+
requirements:
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
hash: 3
|
73
|
+
segments:
|
74
|
+
- 0
|
75
|
+
version: "0"
|
76
|
+
type: :development
|
77
|
+
version_requirements: *id004
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: guard
|
80
|
+
prerelease: false
|
81
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
82
|
+
none: false
|
83
|
+
requirements:
|
84
|
+
- - ">="
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
hash: 3
|
87
|
+
segments:
|
88
|
+
- 0
|
89
|
+
version: "0"
|
90
|
+
type: :development
|
91
|
+
version_requirements: *id005
|
92
|
+
- !ruby/object:Gem::Dependency
|
93
|
+
name: rb-fsevent
|
94
|
+
prerelease: false
|
95
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
96
|
+
none: false
|
97
|
+
requirements:
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
hash: 3
|
101
|
+
segments:
|
102
|
+
- 0
|
103
|
+
version: "0"
|
104
|
+
type: :development
|
105
|
+
version_requirements: *id006
|
106
|
+
- !ruby/object:Gem::Dependency
|
107
|
+
name: growl
|
108
|
+
prerelease: false
|
109
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
110
|
+
none: false
|
111
|
+
requirements:
|
112
|
+
- - ">="
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
hash: 3
|
115
|
+
segments:
|
116
|
+
- 0
|
117
|
+
version: "0"
|
118
|
+
type: :development
|
119
|
+
version_requirements: *id007
|
120
|
+
- !ruby/object:Gem::Dependency
|
121
|
+
name: guard-rspec
|
122
|
+
prerelease: false
|
123
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
124
|
+
none: false
|
125
|
+
requirements:
|
126
|
+
- - ">="
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
hash: 3
|
129
|
+
segments:
|
130
|
+
- 0
|
131
|
+
version: "0"
|
132
|
+
type: :development
|
133
|
+
version_requirements: *id008
|
134
|
+
- !ruby/object:Gem::Dependency
|
135
|
+
name: rails
|
136
|
+
prerelease: false
|
137
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
138
|
+
none: false
|
139
|
+
requirements:
|
140
|
+
- - ">="
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
hash: 7
|
143
|
+
segments:
|
144
|
+
- 3
|
145
|
+
- 0
|
146
|
+
- 0
|
147
|
+
version: 3.0.0
|
148
|
+
type: :runtime
|
149
|
+
version_requirements: *id009
|
150
|
+
description: Provides an API for making any ActiveRecord object transient.
|
151
|
+
email:
|
152
|
+
- jason@lookforwardenterprises.com
|
69
153
|
executables: []
|
70
154
|
|
71
155
|
extensions: []
|
72
156
|
|
73
|
-
extra_rdoc_files:
|
74
|
-
|
75
|
-
- README.rdoc
|
157
|
+
extra_rdoc_files: []
|
158
|
+
|
76
159
|
files:
|
77
160
|
- .document
|
78
161
|
- .gitignore
|
79
|
-
-
|
162
|
+
- .rspec
|
163
|
+
- .rvmrc
|
164
|
+
- Gemfile
|
165
|
+
- Guardfile
|
80
166
|
- LICENSE
|
81
167
|
- README.rdoc
|
82
168
|
- Rakefile
|
83
|
-
- VERSION
|
84
169
|
- lib/date_time_extensions.rb
|
85
170
|
- lib/transient.rb
|
86
171
|
- lib/transient/active_record_extensions.rb
|
87
|
-
-
|
172
|
+
- lib/transient/railtie.rb
|
173
|
+
- lib/transient/version.rb
|
88
174
|
- spec/database.yml
|
89
175
|
- spec/date_time_extensions_spec.rb
|
90
|
-
- spec/
|
91
|
-
- spec/spec.opts
|
176
|
+
- spec/single_active_transient_sharedspec.rb
|
92
177
|
- spec/spec_helper.rb
|
93
178
|
- spec/transient/active_record_extensions_spec.rb
|
94
|
-
- spec/
|
179
|
+
- spec/transient_sharedspec.rb
|
95
180
|
- spec/transient_spec.rb
|
96
181
|
- transient.gemspec
|
97
|
-
|
98
|
-
homepage: http://github.com/midas/transient
|
182
|
+
homepage: https://github.com/midas/transient
|
99
183
|
licenses: []
|
100
184
|
|
101
185
|
post_install_message:
|
102
|
-
rdoc_options:
|
103
|
-
|
186
|
+
rdoc_options: []
|
187
|
+
|
104
188
|
require_paths:
|
105
189
|
- lib
|
106
190
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -123,15 +207,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
207
|
version: "0"
|
124
208
|
requirements: []
|
125
209
|
|
126
|
-
rubyforge_project:
|
127
|
-
rubygems_version: 1.
|
210
|
+
rubyforge_project: transient
|
211
|
+
rubygems_version: 1.8.10
|
128
212
|
signing_key:
|
129
213
|
specification_version: 3
|
130
|
-
summary:
|
214
|
+
summary: ""
|
131
215
|
test_files:
|
216
|
+
- spec/database.yml
|
132
217
|
- spec/date_time_extensions_spec.rb
|
133
|
-
- spec/
|
218
|
+
- spec/single_active_transient_sharedspec.rb
|
134
219
|
- spec/spec_helper.rb
|
135
220
|
- spec/transient/active_record_extensions_spec.rb
|
136
|
-
- spec/
|
221
|
+
- spec/transient_sharedspec.rb
|
137
222
|
- spec/transient_spec.rb
|
data/History.txt
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
= 1.0.2 2010-03-18
|
2
|
-
|
3
|
-
* Fixed bug where the effective_at date when implicitly set was not UTC.
|
4
|
-
* Started using the method calls (self.effective_at) as opposed to the self[:effective_at] whenever possible.
|
5
|
-
* Renamed the effective_at method to expires_at.
|
6
|
-
|
7
|
-
|
8
|
-
= 1.0.1 2009-12-29
|
9
|
-
|
10
|
-
* Added call back to populate effective_at with DateTime.now if it is not explicitly set to something else.
|
11
|
-
* Added presence validation to effective_at.
|
12
|
-
|
13
|
-
|
14
|
-
= 1.0.0 2009-12-26
|
15
|
-
|
16
|
-
* Initial release Ported from another project.
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
1.1.0
|
data/script/console
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# File: script/console
|
3
|
-
irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
|
4
|
-
|
5
|
-
libs = " -r irb/completion"
|
6
|
-
# Perhaps use a console_lib to store any extra methods I may want available in the cosole
|
7
|
-
# libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
|
8
|
-
libs << " -r 'active_record' -r '#{File.dirname(__FILE__) + '/../lib/transient.rb'}'"
|
9
|
-
|
10
|
-
puts "Loading transient gem"
|
11
|
-
exec "#{irb} #{libs} --simple-prompt"
|
data/spec/spec.opts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
--color
|