governor 0.1.0 → 0.1.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/Gemfile.lock +1 -1
- data/README.markdown +74 -1
- data/VERSION +1 -1
- data/app/views/governor/articles/index.html.erb +3 -1
- data/app/views/governor/articles/show.html.erb +1 -0
- data/governor.gemspec +1 -1
- data/lib/governor/controllers/helpers.rb +4 -0
- data/spec/rails_app/Gemfile.lock +1 -1
- metadata +3 -3
data/Gemfile.lock
CHANGED
data/README.markdown
CHANGED
@@ -9,9 +9,82 @@ I'm just getting started, but feel free to poke around. I'm sure that when
|
|
9
9
|
this starts getting functional, I'll write some setup documentation here. And
|
10
10
|
try the specs, they're fresh!
|
11
11
|
|
12
|
+
Dependencies
|
13
|
+
------------
|
14
|
+
|
15
|
+
Some day, Governor will be somewhat independent, but for now, there are some
|
16
|
+
explicit and implicit dependencies. There's the obvious hard dependency on
|
17
|
+
Rails, but the following implicit dependencies exist at the moment:
|
18
|
+
|
19
|
+
* ActiveRecord
|
20
|
+
* [will_paginate](https://github.com/mislav/will_paginate)
|
21
|
+
* [Devise](https://github.com/plataformatec/devise)
|
22
|
+
|
23
|
+
At some point (at least by v1.0), these dependencies will be removed. Sorry
|
24
|
+
about the meantime.
|
25
|
+
|
26
|
+
Setting Up
|
27
|
+
----------
|
28
|
+
|
29
|
+
Governor is a gem, so the first thing to do is to add Governor to your
|
30
|
+
Gemfile.
|
31
|
+
|
32
|
+
gem 'governor'
|
33
|
+
|
34
|
+
Once you've installed the gem into your app, you need to run the generator:
|
35
|
+
|
36
|
+
rails generate governor:install
|
37
|
+
|
38
|
+
This will add an initializer which allows you some loose configuration of
|
39
|
+
Governor. As Governor grows, the initializer will actually get some teeth. Now
|
40
|
+
you're ready to add a model:
|
41
|
+
|
42
|
+
rails generate governor:create_articles [CLASS_NAME]
|
43
|
+
|
44
|
+
`CLASS_NAME` by default is Article, but feel free to specify something else,
|
45
|
+
like Post, Blog, whatever. This will add a model, migration, and route to your
|
46
|
+
app.
|
47
|
+
|
48
|
+
Usage
|
49
|
+
-----
|
50
|
+
|
51
|
+
Now that you have an article model and a set of routes, you're ready to plug
|
52
|
+
it into your app. I'd recommend running `rake routes` to see what routes have
|
53
|
+
been added, as they depend on the model name you chose.
|
54
|
+
|
55
|
+
Authentication/Authorization
|
56
|
+
----------------------------
|
57
|
+
|
58
|
+
For now, Governor checks with Devise to make sure someone's logged in before
|
59
|
+
creating an article, and verifies that the logged in user is an article's
|
60
|
+
author before allowing them to edit. You might have your own rules that you'd
|
61
|
+
rather apply. You'll have to wait until a future version if you want something
|
62
|
+
different, sorry.
|
63
|
+
|
64
|
+
Roadmap
|
65
|
+
-------
|
66
|
+
|
67
|
+
Less of a roadmap as a politician's promise of what will exist in future
|
68
|
+
versions of Governor:
|
69
|
+
|
70
|
+
* Strategies to play nice with different authentication/authorization schemes.
|
71
|
+
* A fleshed-out Governor plugin API.
|
72
|
+
* A few plugins: comments, LiveJournal synchronization, formatting engines,
|
73
|
+
search, permalinks, feeds, and who knows what else.
|
74
|
+
* A chicken in every pot and a car in every garage.
|
75
|
+
|
76
|
+
Until v1.0 (or at least until things start to stabilize), I won't promise
|
77
|
+
anything regarding backwards compatibility. Please let me know if something
|
78
|
+
you were relying on breaks, and I'll do my best to steer you in the right
|
79
|
+
direction or repair functionality.
|
80
|
+
|
12
81
|
Contributing to Governor
|
13
82
|
------------------------
|
14
|
-
|
83
|
+
|
84
|
+
Governor is just getting off the ground now, so while there's a lot to
|
85
|
+
implement, the infrastructure might be too shaky to support multiple
|
86
|
+
developers. Still, if you're interested in improving this, let's talk.
|
87
|
+
|
15
88
|
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
16
89
|
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
17
90
|
* Fork the project
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/governor.gemspec
CHANGED
@@ -5,6 +5,10 @@ module Governor
|
|
5
5
|
url_for :controller => mapping.controller, :governor_mapping => params[:governor_mapping], :action => 'index'
|
6
6
|
end
|
7
7
|
|
8
|
+
def new_resource_url
|
9
|
+
url_for :controller => mapping.controller, :governor_mapping => params[:governor_mapping], :action => 'new'
|
10
|
+
end
|
11
|
+
|
8
12
|
def edit_resource_url(resource)
|
9
13
|
url_for :controller => mapping.controller, :governor_mapping => params[:governor_mapping], :action => 'edit', :id => resource.id
|
10
14
|
end
|
data/spec/rails_app/Gemfile.lock
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: governor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Liam Morley
|