ragamuffins 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +3 -0
- data/Rakefile +21 -0
- data/lib/ragamuffins/engine.rb +4 -0
- data/lib/ragamuffins/hooks.rb +10 -0
- data/lib/ragamuffins/models/active_record_extension.rb +23 -0
- data/lib/ragamuffins/models/active_record_model_extension.rb +19 -0
- data/lib/ragamuffins/railtie.rb +7 -0
- data/lib/ragamuffins/version.rb +3 -0
- data/lib/ragamuffins.rb +17 -0
- data/lib/tasks/ragamuffins_tasks.rake +4 -0
- metadata +83 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e7c1bb9bc3500f535d33f0c20deb182b10934b57
|
4
|
+
data.tar.gz: fcd6441f598ad0e72eda8d75339868216bce638d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9928c271ab0a4ec9bdcc201769942efb5a97af9a4eb5d0cd8999e881acf35a18f68fcc0f91c2c5984aa6598d073f0c2a6f0eb0ee871e600d7f1ad8cbf5383430
|
7
|
+
data.tar.gz: b598c191298465552bc857202c6edb48cd6356f3491286f611bc383338d8da3dec58afad8160f5e39b2defeb54cfdbda761dfa9d508d7f2a1527e4300e064c69
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2014 YOURNAME
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'Ragamuffins'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.rdoc')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
Bundler::GemHelper.install_tasks
|
21
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'ragamuffins/models/active_record_model_extension'
|
2
|
+
|
3
|
+
module Ragamuffins
|
4
|
+
module ActiveRecordExtension
|
5
|
+
extend ActiveSupport::Concern
|
6
|
+
included do
|
7
|
+
# Future subclasses will pick up the model extension
|
8
|
+
class << self
|
9
|
+
def inherited_with_ragamuffins(kls) #:nodoc:
|
10
|
+
inherited_without_ragamuffins kls
|
11
|
+
kls.send(:include, Ragamuffins::ActiveRecordModelExtension) if kls.superclass == ActiveRecord::Base
|
12
|
+
end
|
13
|
+
alias_method_chain :inherited, :ragamuffins
|
14
|
+
end
|
15
|
+
|
16
|
+
# Existing subclasses pick up the model extension as well
|
17
|
+
self.descendants.each do |kls|
|
18
|
+
kls.send(:include, Ragamuffins::ActiveRecordModelExtension) if kls.superclass == ActiveRecord::Base
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Ragamuffins
|
2
|
+
module ActiveRecordModelExtension
|
3
|
+
extend ActiveSupport::Concern
|
4
|
+
|
5
|
+
included do
|
6
|
+
# self.send(:include, Ragamuffins::ConfigurationMethods)
|
7
|
+
|
8
|
+
# Fetch all the deleted ids from the backend, and return them as an array
|
9
|
+
# Model.delted_ids = []
|
10
|
+
eval <<-RUBY
|
11
|
+
def self.show_deleted_ids(ids = [])
|
12
|
+
return [] if ids == nil
|
13
|
+
|
14
|
+
ids.collect{|s| s.to_i} - self.scoped.where('id IN (?)', ids).map(&:id)
|
15
|
+
end
|
16
|
+
RUBY
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/ragamuffins.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
module Ragamuffins
|
2
|
+
end
|
3
|
+
|
4
|
+
# load Rails/Railtie
|
5
|
+
begin
|
6
|
+
require 'rails'
|
7
|
+
rescue LoadError
|
8
|
+
#do nothing
|
9
|
+
end
|
10
|
+
|
11
|
+
# Load All the stuff we need
|
12
|
+
require 'ragamuffins/hooks'
|
13
|
+
|
14
|
+
# if not using Railtie, call `Ragamuffins::Hooks.init` directly
|
15
|
+
if defined? Rails
|
16
|
+
require 'ragamuffins/railtie'
|
17
|
+
end
|
metadata
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ragamuffins
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Isaac Norman
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-04-14 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 4.0.1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 4.0.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: sqlite3
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: A simple gem for finding out which objects have been orphaned on your
|
42
|
+
iOS or Android App.
|
43
|
+
email:
|
44
|
+
- idn@papercloud.com.au
|
45
|
+
executables: []
|
46
|
+
extensions: []
|
47
|
+
extra_rdoc_files: []
|
48
|
+
files:
|
49
|
+
- MIT-LICENSE
|
50
|
+
- README.rdoc
|
51
|
+
- Rakefile
|
52
|
+
- lib/ragamuffins.rb
|
53
|
+
- lib/ragamuffins/engine.rb
|
54
|
+
- lib/ragamuffins/hooks.rb
|
55
|
+
- lib/ragamuffins/models/active_record_extension.rb
|
56
|
+
- lib/ragamuffins/models/active_record_model_extension.rb
|
57
|
+
- lib/ragamuffins/railtie.rb
|
58
|
+
- lib/ragamuffins/version.rb
|
59
|
+
- lib/tasks/ragamuffins_tasks.rake
|
60
|
+
homepage: http://www.github.com/RustComet/Ragamuffins
|
61
|
+
licenses: []
|
62
|
+
metadata: {}
|
63
|
+
post_install_message:
|
64
|
+
rdoc_options: []
|
65
|
+
require_paths:
|
66
|
+
- lib
|
67
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - '>='
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '0'
|
72
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
requirements: []
|
78
|
+
rubyforge_project:
|
79
|
+
rubygems_version: 2.2.2
|
80
|
+
signing_key:
|
81
|
+
specification_version: 4
|
82
|
+
summary: Find your orphans
|
83
|
+
test_files: []
|