sms_auth-twilio 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Binary file
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+ gem 'twilio-ruby'
3
+ gem "rspec"
4
+ # Specify your gem's dependencies in sms_auth-twilio.gemspec
5
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 sherod taylor
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README ADDED
File without changes
@@ -0,0 +1,34 @@
1
+ <<<<<<< HEAD
2
+ sms_auth-twilio
3
+ ===============
4
+ =======
5
+ # SmsAuth::Twilio
6
+
7
+ TODO: Write a gem description
8
+
9
+ ## Installation
10
+
11
+ Add this line to your application's Gemfile:
12
+
13
+ gem 'sms_auth-twilio'
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install sms_auth-twilio
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Contributing
28
+
29
+ 1. Fork it
30
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
31
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
32
+ 4. Push to the branch (`git push origin my-new-feature`)
33
+ 5. Create new Pull Request
34
+ >>>>>>> First Commit
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
Binary file
@@ -0,0 +1,2 @@
1
+ path = File.join(Rails.root, "config/twilio.yml")
2
+ TWILIO_CONFIG = YAML.load(File.read(path))[Rails.env] || {'sid' => '', 'from' => '', 'token' => ''}
@@ -0,0 +1,4 @@
1
+ development:
2
+ from: 'your-from'
3
+ sid: 'your-sid'
4
+ token: 'your-token'
@@ -0,0 +1,18 @@
1
+ class VerificationsController < ApplicationController
2
+
3
+ before_filter :get_user
4
+
5
+ def create
6
+ @user.update_attribute(:verified, true)
7
+ # You could send another message acknowledging the verification
8
+ head :ok
9
+ end
10
+
11
+ private
12
+ def get_user
13
+ unless @user = User.find_by_phone(params['From'])
14
+ head :not_found
15
+ end
16
+ end
17
+
18
+ end
@@ -0,0 +1,23 @@
1
+ require "sms_auth-twilio/version"
2
+
3
+ module SmsAuth
4
+ module Twilio
5
+ class TwilioGenerator < Rails::Generator::base
6
+ ource_root File.expand_path("../generator", __FILE__)
7
+ def add_twilio_initializer
8
+ copy_file "twilio.rb", "config/initializer/twilio.rb"
9
+ end
10
+
11
+ # config info for the API
12
+
13
+ def twilio_config_info
14
+ copy_file "twilio.yml", "config/twilio.yml"
15
+ end
16
+
17
+ # Verification Controller to verify the company
18
+ def copy_verifications
19
+ copy_file "verifications_controller", "app/contoller/verifications_controller.rb"
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,5 @@
1
+ module SmsAuth
2
+ module Twilio
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,22 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'sms_auth-twilio/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "sms_auth-twilio"
8
+ gem.version = SmsAuth::Twilio::VERSION
9
+ gem.authors = ["sherod taylor"]
10
+ gem.email = ["sherodtaylor@gmail.com"]
11
+ gem.description = %q{SMS Authentication}
12
+ gem.summary = %q{SMS Authentication using the twilio service as a gateway.}
13
+ gem.homepage = ""
14
+ gem.add_development_dependency "twilio-ruby"
15
+ gem.add_development_dependency "rspec"
16
+ gem.rubyforge_project = "sms_auth-twilio.rb"
17
+
18
+ gem.files = `git ls-files`.split($/)
19
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
20
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
21
+ gem.require_paths = ["lib"]
22
+ end
metadata ADDED
@@ -0,0 +1,91 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sms_auth-twilio
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - sherod taylor
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-12-01 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: twilio-ruby
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rspec
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ description: SMS Authentication
47
+ email:
48
+ - sherodtaylor@gmail.com
49
+ executables: []
50
+ extensions: []
51
+ extra_rdoc_files: []
52
+ files:
53
+ - .DS_Store
54
+ - .gitignore
55
+ - Gemfile
56
+ - LICENSE.txt
57
+ - README
58
+ - README.md
59
+ - Rakefile
60
+ - lib/.DS_Store
61
+ - lib/generator/twilio.rb
62
+ - lib/generator/twilio.yml
63
+ - lib/generator/verifications_controller.rb
64
+ - lib/sms_auth-twilio.rb
65
+ - lib/sms_auth-twilio/version.rb
66
+ - sms_auth-twilio.gemspec
67
+ homepage: ''
68
+ licenses: []
69
+ post_install_message:
70
+ rdoc_options: []
71
+ require_paths:
72
+ - lib
73
+ required_ruby_version: !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ! '>='
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ required_rubygems_version: !ruby/object:Gem::Requirement
80
+ none: false
81
+ requirements:
82
+ - - ! '>='
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ requirements: []
86
+ rubyforge_project: sms_auth-twilio.rb
87
+ rubygems_version: 1.8.24
88
+ signing_key:
89
+ specification_version: 3
90
+ summary: SMS Authentication using the twilio service as a gateway.
91
+ test_files: []