fundamentalista-rails 0.2.0 → 0.3.0
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
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 042cbcfd7de6b6aa4071a1e7a5594e1255d85f7d378c67f750f439d732c5f773
|
|
4
|
+
data.tar.gz: e2f10ed5b9c2702d22c456969a479c68d0c7040c3182a2cef8ba208fd72133d1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: beefab6e0cbedc3e6f26c03baeec789fe45ea268fbbbc051e443235f82f49fefe66e4fbd1b04bedbaf788328fbd221516c83abe74ec9f21d0d192ac0da9d05eb
|
|
7
|
+
data.tar.gz: 8648be6ef6d194e21f1ba5869f84662a518bc7b81d98e6d66fa55fdfa33535670dae01d0f30026edb0e658b7b04bc18798f5aaf5da124da3e7180448ac286c57
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
- `FundamentalistaRails.parent_controller` names the controller the engine's controllers inherit from, so the host's authentication guards the pages.
|
|
6
|
+
|
|
3
7
|
## 0.2.0
|
|
4
8
|
|
|
5
9
|
- Valuation history on the company page when the provider serves prices, one row per fiscal year at its closing price.
|
data/README.md
CHANGED
|
@@ -28,7 +28,14 @@ Fundamentalista.configure do |config|
|
|
|
28
28
|
end
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
The engine points the gem at `Rails.cache` with a one day expiry unless you set `config.cache` yourself, so a company page costs one download and a watchlist does not hammer the SEC.
|
|
31
|
+
The engine points the gem at `Rails.cache` with a one day expiry unless you set `config.cache` yourself, so a company page costs one download and a watchlist does not hammer the SEC. The engine ships no authentication. Name the controller its controllers inherit from, and your own `before_action` callbacks guard the pages:
|
|
32
|
+
|
|
33
|
+
```ruby
|
|
34
|
+
# config/initializers/fundamentalista.rb
|
|
35
|
+
FundamentalistaRails.parent_controller = "FundamentalsController"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The default is `ActionController::Base`. Inside the engine, route helpers resolve against the engine's routes, so a callback in that controller that redirects to one of your pages uses `main_app.new_session_path`, not `new_session_path`.
|
|
32
39
|
|
|
33
40
|
## Pages
|
|
34
41
|
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
module FundamentalistaRails
|
|
4
4
|
# Base controller of the engine: turns the gem's errors into flash
|
|
5
|
-
# messages and reads prices from parameters.
|
|
6
|
-
|
|
5
|
+
# messages and reads prices from parameters. It inherits from
|
|
6
|
+
# FundamentalistaRails.parent_controller.
|
|
7
|
+
class ApplicationController < FundamentalistaRails.parent_controller.constantize
|
|
7
8
|
protect_from_forgery with: :exception
|
|
9
|
+
helper FiguresHelper
|
|
8
10
|
|
|
9
11
|
rescue_from Fundamentalista::CompanyNotFoundError, Fundamentalista::NoFinancialsError,
|
|
10
12
|
Fundamentalista::UnsupportedPeriodError do |error|
|
|
@@ -19,4 +19,9 @@ module FundamentalistaRails
|
|
|
19
19
|
# as decimals. Set them in an initializer.
|
|
20
20
|
mattr_accessor :risk_free_rate, default: BigDecimal('0.04')
|
|
21
21
|
mattr_accessor :equity_premium, default: BigDecimal('0.05')
|
|
22
|
+
|
|
23
|
+
# The controller the engine's controllers inherit from, as a name, so the
|
|
24
|
+
# host's own authentication and callbacks guard the pages. Set it in an
|
|
25
|
+
# initializer; the engine ships no authentication of its own.
|
|
26
|
+
mattr_accessor :parent_controller, default: 'ActionController::Base'
|
|
22
27
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fundamentalista-rails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bruno Costanzo
|
|
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
100
100
|
- !ruby/object:Gem::Version
|
|
101
101
|
version: '0'
|
|
102
102
|
requirements: []
|
|
103
|
-
rubygems_version: 4.0.
|
|
103
|
+
rubygems_version: 4.0.10
|
|
104
104
|
specification_version: 4
|
|
105
105
|
summary: 'Fundamental analysis pages for Rails: companies, comparisons and watchlists.'
|
|
106
106
|
test_files: []
|