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.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ./
3
3
  specs:
4
- governor (0.0.0)
4
+ governor (0.1.0)
5
5
  rails (~> 3.0.5)
6
6
 
7
7
  GEM
@@ -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.0
1
+ 0.1.1
@@ -1,4 +1,6 @@
1
1
  <h1>List</h1>
2
2
  <% resources.each do |resource| %>
3
3
  <%= link_to resource.title, resource %><br>
4
- <% end %>
4
+ <% end %>
5
+
6
+ <p><%= link_to 'New', new_resource_url %></p>
@@ -7,4 +7,5 @@
7
7
  <%= link_to 'Back', resources_url %>
8
8
  <% if governor_authorized?(:edit, resource) %>
9
9
  | <%= link_to 'Edit', edit_resource_url(resource) %>
10
+ | <%= link_to 'Delete', resource, :method => :delete %>
10
11
  <% end %>
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{governor}
8
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Liam Morley"]
@@ -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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- governor (0.0.0)
4
+ governor (0.1.0)
5
5
  rails (~> 3.0.5)
6
6
 
7
7
  GEM
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: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Liam Morley