meta_magic 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +9 -0
- data/README.md +4 -2
- data/lib/meta_magic/controller.rb +4 -0
- data/lib/meta_magic/version.rb +1 -1
- data/meta_magic.gemspec +4 -3
- data/spec/controller_spec.rb +16 -0
- data/spec/helper_spec.rb +11 -0
- data/spec/spec_helper.rb +12 -2
- metadata +22 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47adca38fb9a0e7482ba9df09c3fe4688cb2ad50
|
4
|
+
data.tar.gz: fbe9c8fa3bd504fddb69192d89570c79e167d7fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7a6c4919f0f98acac4545757c58fc3923418670d9e6029cb9029de5ade8447d9eefc8c267f681e92ffec571f6a513d1aec67e442ff9cee69373c6ba1056b978
|
7
|
+
data.tar.gz: d5795263714e5365195fc7a198be41bdda1de513d18c399c3a76a29e6a51dd21992420fabed6edddb065299f149a4e978361bca1e1dcce5caa0b28aa859b2feb
|
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# MetaMagic
|
2
2
|
|
3
|
-
|
3
|
+
[![Build Status](https://travis-ci.org/johnotander/meta_magic.svg?branch=master)](https://travis-ci.org/johnotander/meta_magic)
|
4
|
+
|
5
|
+
_Currently under development._
|
4
6
|
|
5
7
|
## Installation
|
6
8
|
|
@@ -18,7 +20,7 @@ Or install it yourself as:
|
|
18
20
|
|
19
21
|
## Usage
|
20
22
|
|
21
|
-
|
23
|
+
|
22
24
|
|
23
25
|
## Contributing
|
24
26
|
|
data/lib/meta_magic/version.rb
CHANGED
data/meta_magic.gemspec
CHANGED
@@ -20,7 +20,8 @@ Gem::Specification.new do |spec|
|
|
20
20
|
|
21
21
|
spec.add_dependency 'activesupport'
|
22
22
|
|
23
|
-
spec.add_development_dependency
|
24
|
-
spec.add_development_dependency
|
25
|
-
spec.add_development_dependency
|
23
|
+
spec.add_development_dependency 'bundler', '~> 1.5'
|
24
|
+
spec.add_development_dependency 'rake'
|
25
|
+
spec.add_development_dependency 'rspec'
|
26
|
+
spec.add_development_dependency 'actionpack'
|
26
27
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe MetaMagic::Controller do
|
4
|
+
|
5
|
+
let(:controller) { FakeThingsController.new }
|
6
|
+
|
7
|
+
subject { controller }
|
8
|
+
|
9
|
+
it { should respond_to(:get_model_class) }
|
10
|
+
it { should respond_to(:get_model_instance_variable) }
|
11
|
+
it { should respond_to(:set_model_instance_variable) }
|
12
|
+
|
13
|
+
it 'should return the correct model class' do
|
14
|
+
expect(subject.get_model_class).to eq(FakeThing)
|
15
|
+
end
|
16
|
+
end
|
data/spec/helper_spec.rb
ADDED
data/spec/spec_helper.rb
CHANGED
@@ -2,10 +2,20 @@ require 'rubygems'
|
|
2
2
|
require 'bundler/setup'
|
3
3
|
require 'rspec'
|
4
4
|
|
5
|
+
require 'action_controller'
|
5
6
|
require 'meta_magic'
|
6
7
|
|
7
|
-
I18n.enforce_available_locales = false
|
8
|
-
|
9
8
|
RSpec.configure do |config|
|
10
9
|
config.color_enabled = true
|
11
10
|
end
|
11
|
+
|
12
|
+
class FakeHelper
|
13
|
+
include MetaMagic::Helper
|
14
|
+
end
|
15
|
+
|
16
|
+
class FakeThing
|
17
|
+
end
|
18
|
+
|
19
|
+
class FakeThingsController < ActionController::Base
|
20
|
+
include MetaMagic::Controller
|
21
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: meta_magic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Otander
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: actionpack
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
description: Want to get a path to an AR object, but don't know what the object is?
|
70
84
|
Want to set a controller's instance variable, but don't know what controller you're
|
71
85
|
in. Meta Magic can help.
|
@@ -76,6 +90,7 @@ extensions: []
|
|
76
90
|
extra_rdoc_files: []
|
77
91
|
files:
|
78
92
|
- ".gitignore"
|
93
|
+
- ".travis.yml"
|
79
94
|
- Gemfile
|
80
95
|
- LICENSE.txt
|
81
96
|
- README.md
|
@@ -85,6 +100,8 @@ files:
|
|
85
100
|
- lib/meta_magic/helper.rb
|
86
101
|
- lib/meta_magic/version.rb
|
87
102
|
- meta_magic.gemspec
|
103
|
+
- spec/controller_spec.rb
|
104
|
+
- spec/helper_spec.rb
|
88
105
|
- spec/spec_helper.rb
|
89
106
|
homepage: https://github.com/johnotander/meta_magic
|
90
107
|
licenses:
|
@@ -112,4 +129,7 @@ specification_version: 4
|
|
112
129
|
summary: Meta Magic concerns for abstract, object-agnostic views, controllers, and
|
113
130
|
models.
|
114
131
|
test_files:
|
132
|
+
- spec/controller_spec.rb
|
133
|
+
- spec/helper_spec.rb
|
115
134
|
- spec/spec_helper.rb
|
135
|
+
has_rdoc:
|