methodmissing-scrooge 1.0.0 → 1.0.1
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/README +0 -0
- data/Rakefile +36 -0
- data/VERSION.yml +4 -0
- data/assets/config/scrooge.yml.template +18 -0
- data/lib/scrooge/profile.rb +1 -1
- data/rails/init.rb +10 -0
- data/tasks/scrooge.rake +43 -0
- metadata +9 -2
data/README
ADDED
File without changes
|
data/Rakefile
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
begin
|
2
|
+
require 'spec'
|
3
|
+
rescue LoadError
|
4
|
+
require 'rubygems'
|
5
|
+
require 'spec'
|
6
|
+
end
|
7
|
+
|
8
|
+
require 'spec/rake/spectask'
|
9
|
+
|
10
|
+
$LOAD_PATH.unshift File.dirname(__FILE__) + '/../'
|
11
|
+
$LOAD_PATH.unshift File.dirname(__FILE__) + '/lib'
|
12
|
+
|
13
|
+
require 'scrooge'
|
14
|
+
|
15
|
+
desc "Run the specs under spec"
|
16
|
+
Spec::Rake::SpecTask.new do |t|
|
17
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
18
|
+
t.spec_opts << "-c"
|
19
|
+
end
|
20
|
+
|
21
|
+
begin
|
22
|
+
require 'jeweler'
|
23
|
+
Jeweler::Tasks.new do |s|
|
24
|
+
s.name = "scrooge"
|
25
|
+
s.summary = "Scrooge - Fetch exactly what you need"
|
26
|
+
s.email = "lourens@methodmissing.com"
|
27
|
+
s.homepage = "http://github.com/methodmissing/scrooge"
|
28
|
+
s.description = "A Framework and ORM agnostic Model / record attribute tracker to ensure production
|
29
|
+
Ruby applications only fetch the database content needed to minimize wire traffic
|
30
|
+
and reduce conversion overheads to native Ruby types."
|
31
|
+
s.authors = ["Lourens Naudé"]
|
32
|
+
s.files = FileList["[A-Z]*", "{lib,spec,rails,assets,tasks}/**/*"]
|
33
|
+
end
|
34
|
+
rescue LoadError
|
35
|
+
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
36
|
+
end
|
data/VERSION.yml
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
production:
|
2
|
+
orm: :active_record
|
3
|
+
storage: :memory
|
4
|
+
scope:
|
5
|
+
on_missing_attribute: :reload # or :raise
|
6
|
+
enabled: true
|
7
|
+
development:
|
8
|
+
orm: :active_record
|
9
|
+
storage: :memory
|
10
|
+
scope:
|
11
|
+
on_missing_attribute: :reload # or :raise
|
12
|
+
enabled: true
|
13
|
+
test:
|
14
|
+
orm: :active_record
|
15
|
+
storage: :memory
|
16
|
+
scope:
|
17
|
+
on_missing_attribute: :reload # or :raise
|
18
|
+
enabled: true
|
data/lib/scrooge/profile.rb
CHANGED
data/rails/init.rb
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '..', 'lib', 'scrooge' )
|
2
|
+
|
3
|
+
# Hook to register through Scrooge::Framework::Base.inherited
|
4
|
+
Scrooge::Framework::Rails
|
5
|
+
|
6
|
+
Scrooge::Base.profile = Scrooge::Profile.setup!
|
7
|
+
Scrooge::Base.profile.framework.initialized do
|
8
|
+
Scrooge::Base.profile.log "Initialized"
|
9
|
+
Scrooge::Base.profile.track_or_scope!
|
10
|
+
end
|
data/tasks/scrooge.rake
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
$:.unshift(File.dirname(__FILE__) + '/../lib')
|
2
|
+
|
3
|
+
require 'scrooge'
|
4
|
+
|
5
|
+
Scrooge::Framework::Rails
|
6
|
+
|
7
|
+
namespace :scrooge do
|
8
|
+
|
9
|
+
desc "Copies over the example scrooge.yml file to the host framework's configuration directory"
|
10
|
+
task :setup do
|
11
|
+
Scrooge::Base.setup!
|
12
|
+
end
|
13
|
+
|
14
|
+
desc "List all available Scrooge scopes"
|
15
|
+
task :list do
|
16
|
+
any_scopes do
|
17
|
+
Scrooge::Profile.framework.scopes.each do |scope|
|
18
|
+
puts "- #{scope}"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
desc "Dumps Resources and Models for a given scope to a human friendly format.Assumes ENV['scope'] is set."
|
24
|
+
task :inspect do
|
25
|
+
any_scopes do
|
26
|
+
begin
|
27
|
+
Scrooge::Base.profile.scope_to_signature!( ENV['scope'] )
|
28
|
+
puts Scrooge::Base.profile.tracker.inspect
|
29
|
+
rescue Scrooge::Framework::Base::InvalidScopeSignature
|
30
|
+
puts "Please set ENV['scope'] to the scope you'd like to inspect."
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def any_scopes
|
36
|
+
if Scrooge::Profile.framework.scopes?
|
37
|
+
yield
|
38
|
+
else
|
39
|
+
puts "There's no existing Scrooge scopes!"
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: methodmissing-scrooge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Lourens Naud\xC3\xA9"
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-02-
|
12
|
+
date: 2009-02-10 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -22,7 +22,10 @@ extensions: []
|
|
22
22
|
extra_rdoc_files: []
|
23
23
|
|
24
24
|
files:
|
25
|
+
- Rakefile
|
26
|
+
- README
|
25
27
|
- README.textile
|
28
|
+
- VERSION.yml
|
26
29
|
- lib/scrooge
|
27
30
|
- lib/scrooge/core
|
28
31
|
- lib/scrooge/core/string.rb
|
@@ -79,6 +82,10 @@ files:
|
|
79
82
|
- spec/units/scrooge/tracker/model_spec.rb
|
80
83
|
- spec/units/scrooge/tracker/resource_spec.rb
|
81
84
|
- spec/units/scrooge_spec.rb
|
85
|
+
- rails/init.rb
|
86
|
+
- assets/config
|
87
|
+
- assets/config/scrooge.yml.template
|
88
|
+
- tasks/scrooge.rake
|
82
89
|
has_rdoc: true
|
83
90
|
homepage: http://github.com/methodmissing/scrooge
|
84
91
|
post_install_message:
|