Commit Graph

133 Commits

Author SHA1 Message Date
Hakan Ensari
9862a10685 Remove duplicate code 2017-01-08 23:21:57 +00:00
Hakan Ensari
74b9ec11f0 Load tasks only in test env 2017-01-08 23:21:57 +00:00
Hakan Ensari
7b653b1fd8 Cache responses 2017-01-08 23:21:56 +00:00
Hakan Ensari
34b631a0a4 Update Ruby version 2017-01-08 23:21:56 +00:00
Hakan Ensari
60f980a6ee Fold conversion into quote 2017-01-03 12:44:13 +00:00
Hakan Ensari
4a1f4ca3c1 Use Rubocop and fix existing offences 2017-01-03 12:36:05 +00:00
Vincent Durand
597792c988 Update rescued exception
The converter API allows the date as parameter and it needs to be
rescued with an invalid date, and the exception is
`PG::InvalidDatetimeFormat`, so the safest solution was to use the
first ancestor of this exception which is the same one as the current
`PG::DatetimeFieldOverflow`.
2016-09-22 19:02:42 +02:00
Vincent Durand
ad64574745 Add GET #converter API route
It adds a quote helper which return the Quote instance
to be injected, and uses this new object for the quote's attributes.
2016-09-22 18:53:31 +02:00
Vincent Durand
46dbb66b0f Implement Converter
The API is fairly simple in order to get straight to the goal, convert
an amount from a currency to another.
I used the proposal from #25 which is similar to the google currency
tool.
2016-09-22 18:51:27 +02:00
Hakan Ensari
2bb4aeb497 Configure rack cors 2016-06-08 14:49:43 +01:00
Hakan Ensari
d063f1ab24 Remove obsolete line 2016-05-09 12:01:51 +01:00
Hakan Ensari
250095d262 Use rack-cors
We will only return Access-Control headers if request includes an
Origin header

Fixes #18
2016-05-09 11:51:54 +01:00
Hakan Ensari
07781b6d76 Use Oj to generate JSON
Warming up --------------------------------------
                json    16.465k i/100ms
                yajl    18.574k i/100ms
                  oj    34.073k i/100ms
Calculating -------------------------------------
                json    182.828k (± 7.8%) i/s -    922.040k in
5.075699s
                yajl    196.839k (± 4.5%) i/s -    984.422k in
5.011087s
                  oj    384.813k (± 5.9%) i/s -      1.942M in
5.065475s

Comparison:
                  oj:   384813.2 i/s
                yajl:   196839.0 i/s - 1.95x slower
                json:   182827.5 i/s - 2.10x slower
2016-05-09 11:51:54 +01:00
Hakan Ensari
92ed532543 Fix OPTIONS requests
#18
2016-04-25 19:10:15 +01:00
Hakan Ensari
ce44d37fe0 Remove redundant logic 2016-04-25 18:59:07 +01:00
Hakan Ensari
702f6ac9aa Refactor internals
- Removed yajl-ruby
- Removed sinatra-jsonp
- Inlined #halt_with_message
- Added last_modified header to root path
2016-04-24 17:15:02 +01:00
Hakan Ensari
59df76477e Further refactor cross-origin
- Add all [required
headers](https://github.com/britg/sinatra-cross_origin/blob/master/lib/s
inatra/cross_origin.rb#L51-L58)
- Respond to preflight requests

#18
2016-04-24 16:19:36 +01:00
Hakan Ensari
1d059cd049 Refactor cross-origin
- Drop cross_origin gem
- Add header to all responses

#18
2016-04-24 15:39:08 +01:00
Hakan Ensari
055017f68a Drop Virtus dependency 2016-04-11 15:05:41 +01:00
Hakan Ensari
b6b697872e Set TargetRubyVersion to 2.3 in Rubocop 2016-04-11 15:05:15 +01:00
Hakan Ensari
d7b6e8c898 Suppress warnings 2016-04-11 14:40:24 +01:00
Hakan Ensari
9d0ed94abe Refactor quote validation 2016-04-11 14:40:24 +01:00
Hakan Ensari
2f1c9b796b Wrap bulk insert in a transaction 2016-04-11 14:39:23 +01:00
Hakan Ensari
bb60fa8eba Use Rubocop 2016-04-11 14:39:15 +01:00
Hakan Ensari
bfe8313418 Use frozen_string_literal comment 2015-12-30 19:52:02 +00:00
Hakan Ensari
af9f63f002 Refactor Quote 2015-12-22 19:46:10 +00:00
Hakan Ensari
2edf0fd19e Remove syntactic sugar 2015-09-16 10:33:22 +01:00
Hakan Ensari
be1dcce266 Set default date at run time
Fixes #11
2015-09-15 12:02:49 +01:00
Hakan Ensari
5094956f7c Add Last Modified header 2015-09-15 12:01:16 +01:00
Hakan Ensari
c1f2ed25e7 Refactor Api 2015-09-15 12:00:57 +01:00
Hakan Ensari
af13a6324a Refactor rounding 2015-09-02 22:13:53 +01:00
Hakan Ensari
15e8d8b19b Round to five significant digits
Fixes #10
2015-09-02 22:12:42 +01:00
Hakan Ensari
ddc0439340 Revert custom error 2015-09-02 22:11:57 +01:00
Hakan Ensari
62f1ab2237 Use custom error 2015-09-01 13:04:29 +01:00
Hakan Ensari
60719cd215 Refactor Quote 2015-08-31 10:56:01 +01:00
Hakan Ensari
1c128eb84c Convert Snapshot into value object 2015-08-30 11:54:49 +01:00
Hakan Ensari
d4b98eef49 Remove Rollbar 2015-08-30 11:54:49 +01:00
Hakan Ensari
b95a2c5ee6 Refactor Currency 2015-08-30 11:54:48 +01:00
Hakan Ensari
4c72b6a139 Fix Rubocop warnings 2015-05-25 12:13:05 +01:00
Hakan Ensari
2bed405d0f Use error helper in development 2015-05-25 12:12:35 +01:00
Hakan Ensari
14985cf3e8 Deploy to Digital Ocean 2015-03-09 14:56:52 +00:00
hakanensari
61eb0b4c7e Remove Honeybadger middleware in production 2015-01-05 16:51:52 +01:00
hakanensari
1d6c36eb3c Switch to Rollbar 2015-01-05 16:21:37 +01:00
hakanensari
4479d14682 Change root output 2015-01-05 16:18:36 +01:00
hakanensari
f479803a92 Allow cross-origin
Closes #2
2014-10-07 12:08:28 +01:00
hakanensari
286a8953d3 Change name 2014-06-19 12:33:53 +01:00
hakanensari
c7c98881b9 Return JSON on error 2014-06-19 12:31:47 +01:00
hakanensari
76aa21c239 Add root path 2014-06-19 12:31:35 +01:00
hakanensari
36a49d848c Merge branch 'master' of github.com:papercavalier/fixer-io
Conflicts:
	.ruby-version
	Gemfile.lock
	lib/snapshot.rb
	spec/api_spec.rb
2014-05-16 20:39:14 +01:00
hakanensari
3c146f643f Handle more edge cases 2014-05-16 20:35:16 +01:00
Hakan Ensari
6753fcc49f Add Librato Rack 2014-05-13 11:39:38 +01:00
Hakan Ensari
235a9e0c27 Move middleware to api file 2014-05-13 11:39:27 +01:00
Hakan Ensari
a73e9ddc7d Handle malformed query 2014-05-13 03:08:33 +01:00
hakanensari
8b47118725 Add Newrelic 2014-05-01 11:59:27 +01:00
hakanensari
8d007357b1 Revert "Filter using an expression"
This reverts commit 39164022e6.
2014-03-17 10:14:26 +00:00
hakanensari
0931da3add Improve error handling 2014-03-17 10:10:39 +00:00
hakanensari
39164022e6 Filter using an expression 2014-03-17 10:09:32 +00:00
hakanensari
043dd4d4be Match date 2014-03-14 15:13:09 +00:00
hakanensari
e80a0e00a3 Add environment task 2014-03-14 12:49:16 +00:00
hakanensari
dc03a5838f Add Honeybadger 2014-03-14 12:48:58 +00:00
hakanensari
f21c4d1555 Swallow favicon 2014-03-14 12:30:31 +00:00
hakanensari
150836e9f0 Include Virtus.model 2014-03-14 12:20:12 +00:00
hakanensari
f8027c3757 Remove verbose flag 2014-03-14 12:15:27 +00:00
hakanensari
e968c2c6b4 Refactor rake tasks 2014-03-14 12:15:27 +00:00
hakanensari
4fdd65ac3c Use a minimal app framework 2014-03-14 12:15:27 +00:00
hakanensari
2cf3113568 Cosmetic clean-up 2013-04-29 23:56:40 +01:00
hakanensari
804572f0b8 Remove API redirect 2013-04-29 23:56:16 +01:00
hakanensari
2ca8c06af6 Remove index.html 2013-04-29 23:55:33 +01:00
Hakan Ensari
4a8993cdfb Work around holidays 2012-11-28 02:16:33 +00:00
Hakan Ensari
a52fadf715 Use api subdomain for api reqs 2012-11-26 19:39:42 +00:00
Hakan Ensari
59a8a28ddb Fix Snapshot#round 2012-11-23 15:11:00 +00:00
Hakan Ensari
15092bce7b Filter symbols 2012-11-23 14:28:55 +00:00
Hakan Ensari
631d42207b Refactor snapshot 2012-11-23 14:13:49 +00:00
Hakan Ensari
4b5c870e15 App is single-threaded 2012-11-21 18:17:29 +00:00
Hakan Ensari
40cf0775d2 Refactor internals of app.rb 2012-11-21 13:18:24 +00:00
Hakan Ensari
d723460b0a Add favicon 2012-11-21 13:18:16 +00:00
Hakan Ensari
19b7a37563 Refactor rebasing 2012-11-21 12:44:33 +00:00
Hakan Ensari
462a87a876 Add comment 2012-11-21 12:33:52 +00:00
Hakan Ensari
6609da520e A first stab at rebasing 2012-11-21 12:31:17 +00:00
Hakan Ensari
6fb6ab7feb Set base currency 2012-11-21 11:31:50 +00:00
Hakan Ensari
9fb80af83e Shorten historical endpoint 2012-11-20 22:24:14 +00:00
Hakan Ensari
cf53d0a028 Add historical rates 2012-11-20 19:32:26 +00:00
Hakan Ensari
97e34dbc14 First commit 2012-11-20 16:36:12 +00:00