nabil_can 0.1.4 → 0.1.5
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 +4 -4
- data/.project +1 -0
- data/lib/nabil_can/version.rb +1 -1
- data/lib/nabil_can.rb +12 -7
- data/nabil_can-0.1.0.gem +0 -0
- data/nabil_can-0.1.1.gem +0 -0
- data/nabil_can-0.1.2.gem +0 -0
- data/nabil_can-0.1.3.gem +0 -0
- data/nabil_can-0.1.4.gem +0 -0
- data/nabil_can.gemspec~ +29 -0
- metadata +9 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b6b0a9cc2c20327c42c3b1f1bc1a8e665dfe9da
|
4
|
+
data.tar.gz: 4938971837b7807ee2279b1401c96566e9a745d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae2da5644f29a445c6fd640c6f47bfc1063ef54136d906192b318552be1fc50f8b924aba1f0d222b43e6ac095459281092078c1ec373a1f4b80c5f27af8ba0a5
|
7
|
+
data.tar.gz: 2674d33024d2fd5fb526552858b03e6d0b41efb1e7cab515548bd1c7fa0569ee1b7b745668a851fa020a9ad3474d154fd0e15b04ca6f2f479d6150a09d68d5c5
|
data/.project
CHANGED
data/lib/nabil_can/version.rb
CHANGED
data/lib/nabil_can.rb
CHANGED
@@ -3,9 +3,14 @@ require "nabil_can/version"
|
|
3
3
|
module NabilCan
|
4
4
|
# Your code goes here...
|
5
5
|
class Ability
|
6
|
+
def initialize
|
7
|
+
req = Request.new
|
8
|
+
host = req.host # => "example.com"
|
9
|
+
port = req.port
|
10
|
+
end
|
6
11
|
def self.sending_http_request(user_id,action_name,model,path,port_no,host_name)
|
7
|
-
@host =
|
8
|
-
@port =
|
12
|
+
@host = host
|
13
|
+
@port = port
|
9
14
|
@path = "#{path}?user_id=#{user_id}&action_name=#{action_name}&model=#{model}"
|
10
15
|
|
11
16
|
request = Net::HTTP::Get.new(@path, initheader = {'Content-Type' =>'application/json'})
|
@@ -18,8 +23,8 @@ end
|
|
18
23
|
def self.can(user_id,action_name,model,port_no,host_name)
|
19
24
|
path='/ability/can'
|
20
25
|
|
21
|
-
ok =sending_http_request(user_id,action_name,model,path,port_no,host_name)
|
22
|
-
if ok=='false'
|
26
|
+
ok = sending_http_request(user_id,action_name,model,path,port_no,host_name)
|
27
|
+
if ok == 'false'
|
23
28
|
return false
|
24
29
|
else
|
25
30
|
return true
|
@@ -28,9 +33,9 @@ end
|
|
28
33
|
end
|
29
34
|
|
30
35
|
def self.cannot(user_id,action_name,model,port_no,host_name)
|
31
|
-
path='/ability/cannot'
|
32
|
-
ok =sending_http_request(user_id,action_name,model,path,port_no,host_name)
|
33
|
-
if ok=='false'
|
36
|
+
path = '/ability/cannot'
|
37
|
+
ok = sending_http_request(user_id,action_name,model,path,port_no,host_name)
|
38
|
+
if ok == 'false'
|
34
39
|
return false
|
35
40
|
else
|
36
41
|
return true
|
data/nabil_can-0.1.0.gem
ADDED
Binary file
|
data/nabil_can-0.1.1.gem
ADDED
Binary file
|
data/nabil_can-0.1.2.gem
ADDED
Binary file
|
data/nabil_can-0.1.3.gem
ADDED
Binary file
|
data/nabil_can-0.1.4.gem
ADDED
Binary file
|
data/nabil_can.gemspec~
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'nabil_can/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "nabil_can"
|
8
|
+
spec.version = NabilCan::VERSION
|
9
|
+
spec.authors = ["mohamednabil00000"]
|
10
|
+
spec.email = ["mohamednabil00000@gmail.com"]
|
11
|
+
|
12
|
+
# if spec.respond_to?(:metadata)
|
13
|
+
# spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com' to prevent pushes to rubygems.org, or delete to allow pushes to any server."
|
14
|
+
# end
|
15
|
+
|
16
|
+
spec.summary = %q{first example}
|
17
|
+
spec.description = %q{first example}
|
18
|
+
spec.homepage = "https://rubygems.org"
|
19
|
+
spec.license = "MIT"
|
20
|
+
|
21
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
22
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
23
|
+
spec.bindir = "exe"
|
24
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
25
|
+
spec.require_paths = ["lib"]
|
26
|
+
|
27
|
+
spec.add_development_dependency "bundler", "~> 1.8"
|
28
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
29
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nabil_can
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mohamednabil00000
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -59,7 +59,13 @@ files:
|
|
59
59
|
- bin/setup
|
60
60
|
- lib/nabil_can.rb
|
61
61
|
- lib/nabil_can/version.rb
|
62
|
+
- nabil_can-0.1.0.gem
|
63
|
+
- nabil_can-0.1.1.gem
|
64
|
+
- nabil_can-0.1.2.gem
|
65
|
+
- nabil_can-0.1.3.gem
|
66
|
+
- nabil_can-0.1.4.gem
|
62
67
|
- nabil_can.gemspec
|
68
|
+
- nabil_can.gemspec~
|
63
69
|
homepage: https://rubygems.org
|
64
70
|
licenses:
|
65
71
|
- MIT
|
@@ -80,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
80
86
|
version: '0'
|
81
87
|
requirements: []
|
82
88
|
rubyforge_project:
|
83
|
-
rubygems_version: 2.
|
89
|
+
rubygems_version: 2.5.1
|
84
90
|
signing_key:
|
85
91
|
specification_version: 4
|
86
92
|
summary: first example
|