trice 0.1.0 → 0.1.1
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 +4 -4
- data/LICENSE.txt +1 -1
- data/README.md +3 -3
- data/lib/trice/railtie.rb +3 -1
- data/lib/trice/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 25190dbc72f712963bc37e9ee966324a5e19b342
|
|
4
|
+
data.tar.gz: 701949aedd85f646106c34e2f89193b8af07bed1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 06408004d555c84c628e40ec675b1a693bb8f54b0f2914b361fa5c31ab8415a1f03c873e5e4d8f829d831194814109c0114e01e74cbdcb0accf0a84a707265b6
|
|
7
|
+
data.tar.gz: 45b39aaf7bd9f5a33a1b082a03b266feefcd24ded644c2689bc7eb6befe7aaf8d60d9ad2944e384775f52fac5385988b3bdd2ff274e4d139cd6124339cc52f88
|
data/LICENSE.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2016 Cookpad Inc.
|
|
3
|
+
Copyright (c) 2016 Kyosuke MOROHASHI, Cookpad Inc.
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/README.md
CHANGED
|
@@ -99,7 +99,7 @@ Value format, which specified both query parameter and header, should be `Time.p
|
|
|
99
99
|
Toggle requested at stubbing in `config/initializers`. The default is below, enabled unelss `Rails.env.production?`.
|
|
100
100
|
|
|
101
101
|
```ruby
|
|
102
|
-
Trice.
|
|
102
|
+
Trice.support_requested_at_stubbing = !Rails.env.production?
|
|
103
103
|
```
|
|
104
104
|
|
|
105
105
|
Setting callable object let you choice enable/disable dinamically by seeing request.
|
|
@@ -107,7 +107,7 @@ Setting callable object let you choice enable/disable dinamically by seeing requ
|
|
|
107
107
|
```ruby
|
|
108
108
|
our_office_network = IPAddr.new('203.0.113.0/24')
|
|
109
109
|
|
|
110
|
-
Trice.
|
|
110
|
+
Trice.support_requested_at_stubbing = ->(controller) {
|
|
111
111
|
next true unless Rails.env.production?
|
|
112
112
|
|
|
113
113
|
our_office_network.include?(controller.request.remote_ip)
|
|
@@ -124,7 +124,7 @@ RSpec.configure do |config|
|
|
|
124
124
|
end
|
|
125
125
|
```
|
|
126
126
|
|
|
127
|
-
I recommend to pass reference time to a
|
|
127
|
+
I recommend to pass reference time to a model by method and/or constructor argument because reference time is an external input, should be handled controller layer.
|
|
128
128
|
But sometimes it is required from deep inside of model logics and tests for them.
|
|
129
129
|
|
|
130
130
|
Model unit spec has `with_refrence_time` and `set_now_to_reference_time` declarition method to set `Trice.reference_time` in an example.
|
data/lib/trice/railtie.rb
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
module Trice
|
|
2
2
|
class Railtie < ::Rails::Railtie
|
|
3
3
|
initializer 'trice' do |app|
|
|
4
|
-
Trice.support_requested_at_stubbing
|
|
4
|
+
if Trice.support_requested_at_stubbing.nil?
|
|
5
|
+
Trice.support_requested_at_stubbing = !Rails.env.production?
|
|
6
|
+
end
|
|
5
7
|
end
|
|
6
8
|
end
|
|
7
9
|
end
|
data/lib/trice/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: trice
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- moro
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-02-
|
|
11
|
+
date: 2016-02-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|