movile_sms 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 9ad5da82b0d0cecbb15f2a653607caefeac3e01e
4
+ data.tar.gz: 20d128c4211086067a496939e731a67f1c272c4c
5
+ SHA512:
6
+ metadata.gz: 32dddfc53f44549c3d0a1f94ae78a5efe3f41d7f3bd22e521c7d9bf287af68073ae4189634af19053efac0639ff0e1757aa62257dbd0370ce56b643f35f07f8e
7
+ data.tar.gz: e4ad641e7ed4c47d5021d762eae36c74f443a3a3ae97814508dc260e3c692479053367b32e1e52845660e04a4a1d8409b205c235a9579088f38d05164564710b
data/.byebug_history ADDED
@@ -0,0 +1,63 @@
1
+ exit
2
+ File.expand_path File.dirname(__FILE__)
3
+ Dir.now
4
+ Dir
5
+ require './lib/movile_sms'
6
+ ls
7
+ pwd
8
+ exit
9
+ next
10
+ body.to_json
11
+ body
12
+ exit
13
+ body.to_json
14
+ body = {:destination => number, :messageText => text }
15
+ body = body: {:destination => number, :messageText => text }
16
+ body = body: { 'destination' => number, 'messageText' => text }
17
+ body: body: { 'destination' => number, 'messageText' => text }
18
+ body
19
+ number
20
+ self.class.post(BASE_API_URL, body: { 'destination' => number, 'messageText' => text }.to_json, headers: @options)
21
+ self.class
22
+ exit
23
+ attributes[:username]
24
+ attributes
25
+ attrubutes
26
+ continue
27
+ @options
28
+ @options.is_a? Hash
29
+ exit
30
+ @options.is_a? Array
31
+ @options.is_a? Hash
32
+ @options
33
+ continue
34
+ response
35
+ continue
36
+ next
37
+ response
38
+ next
39
+ response
40
+ next
41
+ @options
42
+ continue
43
+ HTTParty.post(BASE_API_URL, @options)
44
+ BASE_API_URL
45
+ @options
46
+ continue
47
+ @options
48
+ exit
49
+ @options
50
+ @options[:query]
51
+ @options
52
+ @@options
53
+ @options
54
+ exit
55
+ #{base_api_url}
56
+ Sms::base_api_url
57
+ base_api_url
58
+ continue
59
+ @username
60
+ next
61
+ exit
62
+ attributes[0]
63
+ attributes
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in movile_sms.gemspec
4
+ gemspec
data/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # MovileSms
2
+
3
+ Movile SMS is a gem so you can send sms through the Movile API. It's simple and easy to integrate and start sending your messages.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'movile_sms'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install movile_sms
20
+
21
+ ## Usage
22
+
23
+ TODO: Write usage instructions here
24
+
25
+ ## Development
26
+
27
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
28
+
29
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
30
+
31
+ ## Contributing
32
+
33
+ Bug reports and pull requests are welcome on GitHub at https://github.com/chiligumdev/movile_sms.
34
+
data/Rakefile ADDED
@@ -0,0 +1,7 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
3
+
4
+
5
+ task :console do
6
+ exec "irb -r movile_sms -I ./lib"
7
+ end
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "movile_sms"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,17 @@
1
+ #require 'byebug'
2
+
3
+ class Sms
4
+ include HTTParty
5
+
6
+ BASE_API_URL = 'https://api-messaging.movile.com/v1/send-sms'
7
+
8
+ def initialize(attributes)
9
+ @options = { 'UserName' => attributes[:username], 'AuthenticationToken' => attributes[:access_token], 'Content-Type' => 'application/json' }
10
+ end
11
+
12
+ def send_message(number, text)
13
+ body = { "destination" => number.to_s, "messageText" => text.to_s }.to_json
14
+ response = self.class.post(BASE_API_URL, headers: @options, body: body )
15
+ end
16
+
17
+ end
@@ -0,0 +1,3 @@
1
+ module MovileSms
2
+ VERSION = "0.1.0"
3
+ end
data/lib/movile_sms.rb ADDED
@@ -0,0 +1,10 @@
1
+ require 'httparty'
2
+ require 'json'
3
+ require "movile_sms/version"
4
+ require "movile_sms/sms"
5
+
6
+ module MovileSms
7
+
8
+
9
+
10
+ end
@@ -0,0 +1,35 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'movile_sms/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "movile_sms"
8
+ spec.version = MovileSms::VERSION
9
+ spec.authors = ["Leandro"]
10
+ spec.email = ["lndr.figueredo@gmail.com"]
11
+ spec.summary = %q{Send sms messages with Movile API.}
12
+ spec.description = %q{Simple way to integrate and send messages with movile API}
13
+ spec.homepage = ""
14
+
15
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
16
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
17
+ if spec.respond_to?(:metadata)
18
+ spec.metadata['allowed_push_host'] = "https://rubygems.org"
19
+ else
20
+ raise "RubyGems 2.0 or newer is required to protect against " \
21
+ "public gem pushes."
22
+ end
23
+
24
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
25
+ f.match(%r{^(test|spec|features)/})
26
+ end
27
+ spec.bindir = "exe"
28
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
+ spec.require_paths = ["lib"]
30
+ spec.add_development_dependency "bundler", "~> 1.13"
31
+ spec.add_development_dependency "rake", "~> 10.0"
32
+ spec.add_development_dependency "minitest"
33
+ spec.add_dependency "httparty"
34
+ spec.add_dependency "json"
35
+ end
metadata ADDED
@@ -0,0 +1,125 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: movile_sms
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Leandro
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2017-05-30 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.13'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.13'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: minitest
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: httparty
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: json
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description: Simple way to integrate and send messages with movile API
84
+ email:
85
+ - lndr.figueredo@gmail.com
86
+ executables: []
87
+ extensions: []
88
+ extra_rdoc_files: []
89
+ files:
90
+ - ".byebug_history"
91
+ - ".gitignore"
92
+ - Gemfile
93
+ - README.md
94
+ - Rakefile
95
+ - bin/console
96
+ - bin/setup
97
+ - lib/movile_sms.rb
98
+ - lib/movile_sms/sms.rb
99
+ - lib/movile_sms/version.rb
100
+ - movile_sms.gemspec
101
+ homepage: ''
102
+ licenses: []
103
+ metadata:
104
+ allowed_push_host: https://rubygems.org
105
+ post_install_message:
106
+ rdoc_options: []
107
+ require_paths:
108
+ - lib
109
+ required_ruby_version: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - ">="
112
+ - !ruby/object:Gem::Version
113
+ version: '0'
114
+ required_rubygems_version: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ requirements: []
120
+ rubyforge_project:
121
+ rubygems_version: 2.4.8
122
+ signing_key:
123
+ specification_version: 4
124
+ summary: Send sms messages with Movile API.
125
+ test_files: []