namaz 0.1.1 → 0.1.2

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: 871d931898844bbe7491afe62ab6c0bde3312f0b
4
- data.tar.gz: cb6f79d1f7dd858e93b70da77c5e2a31ab766aef
3
+ metadata.gz: 307e0c3bb43668c6b4b94ae8da31bf5f50ab1f1c
4
+ data.tar.gz: aef40096f162d0cd1a7ec0d4fc841c601f1bfd85
5
5
  SHA512:
6
- metadata.gz: 4269271a282a9783631b840125f21f09e1b54abf89bb73b357fa3c91f5de0e7ffba626ae0356874ac7c3b9f1a399c48e540ec92ff8b58249235391a3aeac2a82
7
- data.tar.gz: 8e2949eaca4652acc770baa2b37dba51b0312f1de39e40d2020524080c0b48f525f6ba32d130ceee0f4ba0b774daa2ce7780d9c1767a47da8ea146ad0b23757b
6
+ metadata.gz: 7b2c2f99665a1033fe02b061b0e5abe76f0755272bee92550a0af0a20e4417a9fa9917510e38308bdca1921f8c17a9d5eaf10484bfa80791344a76aecb8ce521
7
+ data.tar.gz: fb8cc3ef5b26c008ef6c4201c6d976203b57b8089438f4064faaf101159c0ac667efca1470717bc46fcf1fb2c04fe3ffca4076a8402f586a73dc9ef218df034a
data/README.md CHANGED
@@ -36,7 +36,7 @@ You can then make requests to the following method.
36
36
  ## Using Altitudes:
37
37
  Namaz.timings(latitude:, longitude:, timezonestring:, method:, options: {})
38
38
  ## Using City and Country Information:
39
- Namaz.timings(city:, country:, method:, options: {})
39
+ Namaz.timings_by_city(city:, country:, method:, options: {})
40
40
  ```
41
41
 
42
42
  ### Examples:
@@ -44,7 +44,7 @@ Namaz.timings(city:, country:, method:, options: {})
44
44
  # Using Altitudes:
45
45
  Namaz.timings(latitude: 31.5546, longitude: 74.3572, timezonestring: "Asia/Karachi", method: 1, options: {timestamp: Time.now.to_i})
46
46
  # Using City and Country Information:
47
- Namaz.timings(city: 'Karachi', country: 'PK', method: 1, options: {timestamp: Time.now.to_i})
47
+ Namaz.timings_by_city(city: 'Karachi', country: 'PK', method: 1, options: {timestamp: Time.now.to_i})
48
48
  ```
49
49
 
50
50
  ##### Example Request Using Altitudes
@@ -55,7 +55,7 @@ timings = Namaz.timings(latitude: 31.5546, longitude: 74.3572, timezonestring: "
55
55
  ##### Example Request Using Country and City Information
56
56
 
57
57
  ```ruby
58
- timings = Namaz.timings(city: 'Karachi', country: 'PK', method: 1, options: {state: 'Punjab', timestamp: Time.now.to_i})
58
+ timings = Namaz.timings_by_city(city: 'Karachi', country: 'PK', method: 1, options: {state: 'Punjab', timestamp: Time.now.to_i})
59
59
  ```
60
60
  ##### Example Response
61
61
 
@@ -112,6 +112,24 @@ Namaz.connection = Faraday.new do |builder|
112
112
  end
113
113
  ```
114
114
 
115
+ ## CHANGE LOG:
116
+
117
+ * **0.1.0:** Request Using Altitudes
118
+ * **0.1.1:** Added new request Using Country and City Information
119
+ * **0.1.2:** Updated method name for Timings information for city from `timings` to `timings_by_city`
120
+
121
+ **TODO:**
122
+ Follow the link https://aladhan.com/prayer-times-api and add patch by creating a Pull Rquest, I will merge and publish new version
123
+
124
+ * Calendar
125
+ * Current Time Stamp
126
+ * Current Time
127
+ * City Geolocation Info
128
+ * Address Geolocation Info
129
+ * Calendar by City
130
+ * Timings by Address
131
+ * Calendar by Address
132
+
115
133
  ## License
116
134
 
117
135
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -128,4 +146,4 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
128
146
 
129
147
  ## Contributing
130
148
 
131
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/namaz. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
149
+ Bug reports and pull requests are welcome on GitHub at https://github.com/Sohair63/namaz. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
@@ -10,10 +10,10 @@ module Namaz
10
10
  class << self
11
11
  # Retrieve the namaz timings for a given latitude, longitude, timezonestring and method.
12
12
  #
13
- # @param latitude [Float] Latitude.
14
- # @param longitude [Float] Longitude.
15
- # @param timezonestring [String]
16
- # @param method [Integer]
13
+ # @param [Float] latitude.
14
+ # @param [Float] longitude.
15
+ # @param [String] timezonestring
16
+ # @param [Integer] method
17
17
  # @param options [Hash], Have optional values like timestamp, that is default to Current timestamp
18
18
  def timings(latitude:, longitude:, timezonestring:, method:, options: {})
19
19
  timestamp = options[:timestamp] ? options[:timestamp] : Time.now.to_i
@@ -31,12 +31,12 @@ module Namaz
31
31
 
32
32
  # Retrieve the namaz timings for a given city, country, method.
33
33
  #
34
- # @param latitude [Float] Latitude.
35
- # @param longitude [Float] Longitude.
36
- # @param timezonestring [String]
37
- # @param method [Integer]
38
- # @param options [Hash], Have optional values like timestamp, that is default to Current timestamp
39
- def timings(city:, country:, method:, options: {})
34
+ # @param [String] city
35
+ # @param [String] country
36
+ # @param [String] timezonestring
37
+ # @param [Integer] method
38
+ # @param [Hash] options, Have optional values like timestamp, that is default to Current timestamp
39
+ def timings_by_city(city:, country:, method:, options: {})
40
40
  timestamp = options[:timestamp] ? options[:timestamp] : Time.now.to_i
41
41
  namaz_url = [DEFAULT_API_URL, 'timingsByCity', timestamp].join('/')
42
42
 
@@ -69,8 +69,8 @@ module Namaz
69
69
  end
70
70
 
71
71
  def namaz_response(namaz_url, params)
72
- namaz_response = connection.get(namaz_url, params)
73
- return Hashie::Mash.new(MultiJson.load(namaz_response.body)).data.timings if namaz_response.success?
72
+ response = connection.get(namaz_url, params)
73
+ return Hashie::Mash.new(MultiJson.load(response.body)).data.timings if response.success?
74
74
  end
75
75
  end
76
76
  end
@@ -1,3 +1,3 @@
1
1
  module Namaz
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
@@ -30,6 +30,11 @@ Gem::Specification.new do |spec|
30
30
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
31
  spec.require_paths = ["lib"]
32
32
 
33
+ spec.add_dependency 'faraday', '~> 0'
34
+ spec.add_dependency 'multi_json', '~> 0'
35
+ spec.add_dependency 'hashie', '~> 0'
36
+
37
+ spec.add_development_dependency 'typhoeus', '~> 0'
33
38
  spec.add_development_dependency "bundler", "~> 1.13"
34
39
  spec.add_development_dependency "rake", "~> 10.0"
35
40
  spec.add_development_dependency "rspec", "~> 3.0"
metadata CHANGED
@@ -1,15 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: namaz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sohair Ahmad
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-02-19 00:00:00.000000000 Z
11
+ date: 2017-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: faraday
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: multi_json
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: hashie
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
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: typhoeus
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
13
69
  - !ruby/object:Gem::Dependency
14
70
  name: bundler
15
71
  requirement: !ruby/object:Gem::Requirement