guachiman-rails 1.0.2 → 1.1.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b8d65f3801eb806f31271be46e60acdd3301fb70
4
- data.tar.gz: 120d2f9a3b34f09682552a11158643d47ad83fa0
3
+ metadata.gz: 6e0ad3b3545e4f9d8db485c329053e8bc413a861
4
+ data.tar.gz: 8c0b23aea7bd7d56cbb51c524f6dee2c47a86af1
5
5
  SHA512:
6
- metadata.gz: 240355ca5d98f97eabe7c3f253dcc0f26badbafecde1d57c5f286e187b016a707d154ce7ddd6af04d720cd705b5acf34f62f29383d4351667b044c87aff9df61
7
- data.tar.gz: 7a4426a31cb5224e3d40076d7464be73a2d88cd1550ee8d6dc2144a87c52fe297cd2740cb0819926cd868a32fca40052fbc06323ab6f19ff1d1ebcb841f2ef1c
6
+ metadata.gz: 09d638622867ae6486d6cc56fa7acf72e3115c0420ec56d9fed4b00d0f82c4933a727d3644a9fa2f4ddcb777ed73462b35542ce5ffafca15e10f3cfd3ef97c7f
7
+ data.tar.gz: f8c04739b2574a3cd88a9373bb22332de9858d69c5072ebd0bb18d92ce4ac38731047ab984bfdc032e2d7c52c7215b3dda51fb9089802c4d6bd514a1acab0d33
data/README.md CHANGED
@@ -35,7 +35,7 @@ $ gem install guachiman-rails
35
35
  Upgrade Notice
36
36
  --------------
37
37
 
38
- **Version 1.0.0 is incompatible with version =< 0.3.2.**
38
+ **Version `>= 1.0.0` is incompatible with version `=< 0.3.2`.**
39
39
 
40
40
  Usage
41
41
  -----
@@ -44,7 +44,8 @@ Run `rails g guachiman:install`
44
44
 
45
45
  This will generate a `authorization.rb` file in `app/models`.
46
46
 
47
- Include `Guachiman::Authorizable` in `ApplicationController` and implement a `current_user` method there.
47
+ Include `Guachiman::Authorizable` in `ApplicationController` and optionally implement a
48
+ `current_user` method there (it defaults to `nil`).
48
49
 
49
50
  ```ruby
50
51
  # app/controllers/application_controller.rb
@@ -1,11 +1,11 @@
1
1
  module Guachiman
2
2
  module Generators
3
3
  class InstallGenerator < ::Rails::Generators::Base
4
- desc 'Create Authorization model'
5
- source_root File.expand_path '../templates', __FILE__
4
+ desc "Create Authorization model"
5
+ source_root File.expand_path("../templates", __FILE__)
6
6
 
7
7
  def copy_authorization_model
8
- template 'authorization.rb', 'app/models/authorization.rb'
8
+ template("authorization.rb", "app/models/authorization.rb")
9
9
  end
10
10
  end
11
11
  end
@@ -15,7 +15,7 @@ module Guachiman
15
15
  end
16
16
 
17
17
  def current_user
18
- raise NotImplementedError
18
+ nil
19
19
  end
20
20
 
21
21
  def current_resource
@@ -1,4 +1,4 @@
1
- require 'rails'
1
+ require "rails"
2
2
 
3
3
  module Guachiman
4
4
  module Rails
@@ -1,5 +1,5 @@
1
1
  module Guachiman
2
2
  module Rails
3
- VERSION = "1.0.2"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
@@ -1,4 +1,4 @@
1
- require 'guachiman'
2
- require 'guachiman/rails/version'
3
- require 'guachiman/rails/railtie'
4
- require 'guachiman/rails/authorizable'
1
+ require "guachiman"
2
+ require "guachiman/rails/version"
3
+ require "guachiman/rails/railtie"
4
+ require "guachiman/rails/authorizable"
@@ -1,9 +1,9 @@
1
- require 'test_helper'
2
- require 'rails/generators/test_case'
3
- require 'generators/guachiman/install/install_generator'
1
+ require "test_helper"
2
+ require "rails/generators/test_case"
3
+ require "generators/guachiman/install/install_generator"
4
4
 
5
5
  class InstallGeneratorTest < Rails::Generators::TestCase
6
- DESTINATION = File.expand_path File.join(File.dirname(__FILE__), '..', '..', 'tmp')
6
+ DESTINATION = File.expand_path File.join(File.dirname(__FILE__), "..", "..", "tmp")
7
7
  FileUtils.mkdir_p(DESTINATION) unless Dir.exist?(DESTINATION)
8
8
 
9
9
  destination DESTINATION
@@ -12,17 +12,17 @@ class InstallGeneratorTest < Rails::Generators::TestCase
12
12
  setup :prepare_destination
13
13
 
14
14
  def prepare_destination
15
- if Dir.exists? "#{ DESTINATION }/app"
16
- FileUtils.rm_r "#{ DESTINATION }/app"
15
+ if Dir.exist?("#{ DESTINATION }/app")
16
+ FileUtils.rm_r("#{ DESTINATION }/app")
17
17
  end
18
18
 
19
- FileUtils.mkdir_p "#{ DESTINATION }/app/models"
19
+ FileUtils.mkdir_p("#{ DESTINATION }/app/models")
20
20
  end
21
21
 
22
- test 'create permission' do
22
+ def test_create_authorization_model
23
23
  run_generator
24
24
 
25
- assert_file 'app/models/authorization.rb' do |f|
25
+ assert_file "app/models/authorization.rb" do |f|
26
26
  assert_match(/include Guachiman/, f)
27
27
  end
28
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guachiman-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francesco Rodriguez
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-07-26 00:00:00.000000000 Z
12
+ date: 2014-07-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: guachiman