Commit Graph

108 Commits

Author SHA1 Message Date
Hakan Ensari
e52cdd8512 Fix Rubocop offenses 2018-09-11 18:08:14 +01:00
Hakan Ensari
c6a04ae694 Fix ECB url 2018-09-11 18:05:14 +01:00
Hakan Ensari
5789880a59 Update homepage 2018-09-11 17:59:42 +01:00
Hakan Ensari
479ed20142 Return amount 2018-07-20 21:14:26 +01:00
Hakan Ensari
09ec280a81 Drop Guard, use Sass 2018-07-20 21:14:26 +01:00
Hakan Ensari
a96e56808e Implement time series
... along with some minor miscellaneous refactoring

This finally completes fixerAPI/fixer#22
2018-07-05 21:30:17 +01:00
Hakan Ensari
95d63c143f Refactor tasks that fetch rates 2018-06-08 15:32:52 +01:00
Hakan Ensari
2c91173ecf Rebrand, serve HTML 2018-06-08 15:32:52 +01:00
Hakan Ensari
a0a981e897 Use ON CONFLICT when fetching all records 2018-03-22 08:49:32 +00:00
Hakan Ensari
9389566ab0 Revert "Add some rake tasks for Docker"
This reverts commit 9d364565f6.
2018-03-17 14:41:44 +00:00
Hakan Ensari
9d364565f6 Add some rake tasks for Docker 2018-03-17 14:39:42 +00:00
Hakan Ensari
fc98543702 Fix quoting amount to specific currency when base is Euro 2018-03-17 14:26:59 +00:00
Hakan Ensari
15813d8e1c Add back base 2018-03-09 12:20:25 +00:00
Hakan Ensari
cfbb4ac4ac Repack app
I'm moving my company's server to a private location now that I have sold the domain. While prepping for this, I've done some cleanup and also threw in changes I had lingering on my hard drive.

- Run a single database query instead of two
- Fold the gem into the app and use Ox instead of REXML
- Simplify error handling logic
- Relax throttling
2018-03-08 23:51:36 +00:00
Hakan Ensari
3319c49dca Spring clean code base
- Bump ruby version
- Remove obsolete files, including deploy artefacts
- Don't use pride when testing
- Store gem and app in same repo
- Switch to asdf
2017-11-09 23:30:13 +00:00
Hakan Ensari
3c4f70cf49 Remove New Relic agent 2017-06-14 23:01:27 +01:00
Hakan Ensari
0e0d1374e8 Fix route syntax 2017-06-14 23:01:27 +01:00
Hakan Ensari
b05ed02b5e Remove app version 2017-06-14 23:01:27 +01:00
Hakan Ensari
40b4e39465 Rubocop fixes 2017-06-14 23:01:27 +01:00
Hakan Ensari
b616346701 Move symbol filtering to Quote 2017-01-10 12:44:22 +00:00
Hakan Ensari
e5cb17d0b9 Drop caching 2017-01-10 12:21:19 +00:00
Hakan Ensari
4dd1acec95 Use rack-cache 2017-01-10 12:06:03 +00:00
Hakan Ensari
7504abe6b4 Remove unnecessary empty lines 2017-01-10 12:06:03 +00:00
Hakan Ensari
3fdae1090b Always set Content-Type to JSON
Fixes #45
2017-01-08 23:21:57 +00:00
Hakan Ensari
2b85a05380 Don't dump errors to log 2017-01-08 23:21:57 +00:00
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