acts-as-messageable 0.5.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +8 -0
- data/.github/workflows/test.yml +152 -0
- data/.rubocop.yml +14 -1
- data/.rubocop_todo.yml +49 -7
- data/.ruby-version +1 -0
- data/Appraisals +11 -0
- data/Dockerfile +2 -1
- data/Gemfile +19 -13
- data/Gemfile.lock +186 -97
- data/README.md +2 -3
- data/Rakefile +6 -1
- data/VERSION +1 -1
- data/acts-as-messageable.gemspec +193 -40
- data/bin/tapioca +29 -0
- data/docker-compose.yml +82 -71
- data/gemfiles/rails_3.2.gemfile +14 -9
- data/gemfiles/rails_4.2.gemfile +14 -9
- data/gemfiles/rails_5.2.gemfile +14 -9
- data/gemfiles/rails_6.0.gemfile +14 -9
- data/gemfiles/rails_7.0.gemfile +29 -0
- data/gemfiles/rails_master.gemfile +15 -9
- data/lib/acts-as-messageable.rb +1 -0
- data/lib/acts_as_messageable/message.rb +62 -5
- data/lib/acts_as_messageable/model.rb +71 -20
- data/lib/acts_as_messageable/rails3.rb +27 -2
- data/lib/acts_as_messageable/rails4.rb +31 -4
- data/lib/acts_as_messageable/rails6.rb +34 -2
- data/lib/acts_as_messageable/railtie.rb +1 -0
- data/lib/acts_as_messageable/relation.rb +18 -2
- data/lib/acts_as_messageable/scopes.rb +11 -0
- data/lib/acts_as_messageable.rb +18 -0
- data/lib/generators/acts_as_messageable/migration/migration_generator.rb +4 -0
- data/lib/generators/acts_as_messageable/migration/templates/migration.rb +1 -0
- data/lib/generators/acts_as_messageable/migration/templates/migration_indexes.rb +1 -0
- data/lib/generators/acts_as_messageable/migration/templates/migration_opened_as_datetime.rb +1 -0
- data/lib/generators/acts_as_messageable/migration/templates/migration_permanent.rb +1 -0
- data/sorbet/config +4 -0
- data/sorbet/rbi/annotations/actionpack.rbi +428 -0
- data/sorbet/rbi/annotations/actionview.rbi +77 -0
- data/sorbet/rbi/annotations/activerecord.rbi +18 -0
- data/sorbet/rbi/annotations/activesupport.rbi +52 -0
- data/sorbet/rbi/annotations/faraday.rbi +17 -0
- data/sorbet/rbi/annotations/railties.rbi +58 -0
- data/sorbet/rbi/annotations/rainbow.rbi +269 -0
- data/sorbet/rbi/dsl/abstract_controller/caching/fragments.rbi +23 -0
- data/sorbet/rbi/dsl/abstract_controller/caching.rbi +30 -0
- data/sorbet/rbi/dsl/abstract_controller/callbacks.rbi +23 -0
- data/sorbet/rbi/dsl/abstract_controller/helpers.rbi +23 -0
- data/sorbet/rbi/dsl/abstract_controller/rendering.rbi +9 -0
- data/sorbet/rbi/dsl/abstract_controller/url_for.rbi +23 -0
- data/sorbet/rbi/dsl/action_controller/caching.rbi +29 -0
- data/sorbet/rbi/dsl/action_controller/conditional_get.rbi +23 -0
- data/sorbet/rbi/dsl/action_controller/content_security_policy.rbi +31 -0
- data/sorbet/rbi/dsl/action_controller/data_streaming.rbi +9 -0
- data/sorbet/rbi/dsl/action_controller/etag_with_flash.rbi +24 -0
- data/sorbet/rbi/dsl/action_controller/etag_with_template_digest.rbi +30 -0
- data/sorbet/rbi/dsl/action_controller/flash.rbi +19 -0
- data/sorbet/rbi/dsl/action_controller/form_builder.rbi +19 -0
- data/sorbet/rbi/dsl/action_controller/helpers.rbi +36 -0
- data/sorbet/rbi/dsl/action_controller/params_wrapper.rbi +23 -0
- data/sorbet/rbi/dsl/action_controller/redirecting.rbi +24 -0
- data/sorbet/rbi/dsl/action_controller/renderers/all.rbi +24 -0
- data/sorbet/rbi/dsl/action_controller/renderers.rbi +23 -0
- data/sorbet/rbi/dsl/action_controller/request_forgery_protection.rbi +31 -0
- data/sorbet/rbi/dsl/action_controller/rescue.rbi +24 -0
- data/sorbet/rbi/dsl/action_controller/test_case/behavior.rbi +24 -0
- data/sorbet/rbi/dsl/action_controller/url_for.rbi +24 -0
- data/sorbet/rbi/dsl/action_dispatch/routing/url_for.rbi +23 -0
- data/sorbet/rbi/dsl/action_view/helpers/form_helper.rbi +10 -0
- data/sorbet/rbi/dsl/action_view/helpers/form_tag_helper.rbi +10 -0
- data/sorbet/rbi/dsl/action_view/helpers/text_helper.rbi +9 -0
- data/sorbet/rbi/dsl/action_view/helpers.rbi +10 -0
- data/sorbet/rbi/dsl/action_view/layouts.rbi +24 -0
- data/sorbet/rbi/dsl/action_view/rendering.rbi +9 -0
- data/sorbet/rbi/dsl/active_model/attribute_methods.rbi +27 -0
- data/sorbet/rbi/dsl/active_model/attributes.rbi +34 -0
- data/sorbet/rbi/dsl/active_model/dirty.rbi +28 -0
- data/sorbet/rbi/dsl/active_model/serializers/json.rbi +22 -0
- data/sorbet/rbi/dsl/active_model/validations/callbacks.rbi +22 -0
- data/sorbet/rbi/dsl/active_model/validations.rbi +27 -0
- data/sorbet/rbi/dsl/active_record/attribute_methods/dirty.rbi +38 -0
- data/sorbet/rbi/dsl/active_record/attribute_methods/time_zone_conversion.rbi +32 -0
- data/sorbet/rbi/dsl/active_record/attribute_methods.rbi +53 -0
- data/sorbet/rbi/dsl/active_record/attributes.rbi +19 -0
- data/sorbet/rbi/dsl/active_record/callbacks.rbi +22 -0
- data/sorbet/rbi/dsl/active_record/core.rbi +55 -0
- data/sorbet/rbi/dsl/active_record/encryption/encryptable_record.rbi +23 -0
- data/sorbet/rbi/dsl/active_record/inheritance.rbi +27 -0
- data/sorbet/rbi/dsl/active_record/integration.rbi +32 -0
- data/sorbet/rbi/dsl/active_record/locking/optimistic.rbi +22 -0
- data/sorbet/rbi/dsl/active_record/model_schema.rbi +52 -0
- data/sorbet/rbi/dsl/active_record/nested_attributes.rbi +22 -0
- data/sorbet/rbi/dsl/active_record/readonly_attributes.rbi +19 -0
- data/sorbet/rbi/dsl/active_record/reflection.rbi +32 -0
- data/sorbet/rbi/dsl/active_record/scoping/default.rbi +23 -0
- data/sorbet/rbi/dsl/active_record/scoping.rbi +23 -0
- data/sorbet/rbi/dsl/active_record/serialization.rbi +22 -0
- data/sorbet/rbi/dsl/active_record/signed_id.rbi +22 -0
- data/sorbet/rbi/dsl/active_record/test_fixtures.rbi +58 -0
- data/sorbet/rbi/dsl/active_record/timestamp.rbi +23 -0
- data/sorbet/rbi/dsl/active_record/validations.rbi +28 -0
- data/sorbet/rbi/dsl/active_support/actionable_error.rbi +23 -0
- data/sorbet/rbi/dsl/active_support/callbacks.rbi +22 -0
- data/sorbet/rbi/dsl/active_support/rescuable.rbi +23 -0
- data/sorbet/rbi/dsl/active_support/testing/file_fixtures.rbi +22 -0
- data/sorbet/rbi/gems/actionpack@7.0.4.3.rbi +19265 -0
- data/sorbet/rbi/gems/actionview@7.0.4.3.rbi +15482 -0
- data/sorbet/rbi/gems/activemodel@7.0.4.3.rbi +6025 -0
- data/sorbet/rbi/gems/activerecord@7.0.4.3.rbi +37852 -0
- data/sorbet/rbi/gems/activesupport@7.0.4.3.rbi +18788 -0
- data/sorbet/rbi/gems/addressable@2.4.0.rbi +8 -0
- data/sorbet/rbi/gems/appraisal@2.4.1.rbi +584 -0
- data/sorbet/rbi/gems/ast@2.4.2.rbi +584 -0
- data/sorbet/rbi/gems/builder@3.2.4.rbi +8 -0
- data/sorbet/rbi/gems/coderay@1.1.3.rbi +3426 -0
- data/sorbet/rbi/gems/commander@4.6.0.rbi +8 -0
- data/sorbet/rbi/gems/concurrent-ruby@1.2.2.rbi +11545 -0
- data/sorbet/rbi/gems/coveralls_reborn@0.27.0.rbi +8 -0
- data/sorbet/rbi/gems/crass@1.0.6.rbi +622 -0
- data/sorbet/rbi/gems/descendants_tracker@0.0.4.rbi +8 -0
- data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +1079 -0
- data/sorbet/rbi/gems/docile@1.4.0.rbi +8 -0
- data/sorbet/rbi/gems/erubi@1.12.0.rbi +146 -0
- data/sorbet/rbi/gems/faraday@0.9.2.rbi +964 -0
- data/sorbet/rbi/gems/git@1.11.0.rbi +2700 -0
- data/sorbet/rbi/gems/github_api@0.16.0.rbi +8 -0
- data/sorbet/rbi/gems/hashie@5.0.0.rbi +8 -0
- data/sorbet/rbi/gems/highline@2.0.3.rbi +8 -0
- data/sorbet/rbi/gems/i18n@1.12.0.rbi +2296 -0
- data/sorbet/rbi/gems/jeweler@2.3.9.rbi +1591 -0
- data/sorbet/rbi/gems/json@2.6.3.rbi +1541 -0
- data/sorbet/rbi/gems/jwt@2.5.0.rbi +8 -0
- data/sorbet/rbi/gems/loofah@2.19.1.rbi +904 -0
- data/sorbet/rbi/gems/method_source@1.0.0.rbi +272 -0
- data/sorbet/rbi/gems/mime-types@2.99.3.rbi +8 -0
- data/sorbet/rbi/gems/minitest@5.18.0.rbi +1491 -0
- data/sorbet/rbi/gems/multi_json@1.15.0.rbi +8 -0
- data/sorbet/rbi/gems/multi_xml@0.6.0.rbi +8 -0
- data/sorbet/rbi/gems/multipart-post@2.2.3.rbi +8 -0
- data/sorbet/rbi/gems/netrc@0.11.0.rbi +158 -0
- data/sorbet/rbi/gems/nokogiri@1.14.2.rbi +7244 -0
- data/sorbet/rbi/gems/oauth2@1.4.8.rbi +8 -0
- data/sorbet/rbi/gems/parallel@1.22.1.rbi +277 -0
- data/sorbet/rbi/gems/pg@1.4.6.rbi +2574 -0
- data/sorbet/rbi/gems/polyfill@1.9.0.rbi +8 -0
- data/sorbet/rbi/gems/pry@0.14.2.rbi +10081 -0
- data/sorbet/rbi/gems/psych@4.0.6.rbi +1819 -0
- data/sorbet/rbi/gems/racc@1.6.2.rbi +155 -0
- data/sorbet/rbi/gems/rack-test@2.0.2.rbi +943 -0
- data/sorbet/rbi/gems/rack@2.2.6.4.rbi +5659 -0
- data/sorbet/rbi/gems/rails-dom-testing@2.0.3.rbi +455 -0
- data/sorbet/rbi/gems/rails-html-sanitizer@1.5.0.rbi +685 -0
- data/sorbet/rbi/gems/railties@7.0.4.3.rbi +4553 -0
- data/sorbet/rbi/gems/rainbow@3.1.1.rbi +8 -0
- data/sorbet/rbi/gems/rake@13.0.6.rbi +2959 -0
- data/sorbet/rbi/gems/rbi@0.0.16.rbi +3008 -0
- data/sorbet/rbi/gems/rbs@2.8.0.rbi +8 -0
- data/sorbet/rbi/gems/rchardet@1.8.0.rbi +1078 -0
- data/sorbet/rbi/gems/rdoc@6.5.0.rbi +12441 -0
- data/sorbet/rbi/gems/regexp_parser@2.7.0.rbi +8 -0
- data/sorbet/rbi/gems/rexml@3.2.5.rbi +8 -0
- data/sorbet/rbi/gems/rspec-core@3.12.0.rbi +10798 -0
- data/sorbet/rbi/gems/rspec-expectations@3.12.0.rbi +8090 -0
- data/sorbet/rbi/gems/rspec-mocks@3.12.0.rbi +5296 -0
- data/sorbet/rbi/gems/rspec-support@3.12.0.rbi +1617 -0
- data/sorbet/rbi/gems/rspec@3.12.0.rbi +88 -0
- data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +8 -0
- data/sorbet/rbi/gems/safe_type@1.1.1.rbi +8 -0
- data/sorbet/rbi/gems/semver2@3.4.2.rbi +8 -0
- data/sorbet/rbi/gems/simplecov-html@0.12.3.rbi +8 -0
- data/sorbet/rbi/gems/simplecov@0.22.0.rbi +8 -0
- data/sorbet/rbi/gems/simplecov_json_formatter@0.1.4.rbi +8 -0
- data/sorbet/rbi/gems/sorbet-coerce@0.7.0.rbi +8 -0
- data/sorbet/rbi/gems/stringio@3.0.2.rbi +8 -0
- data/sorbet/rbi/gems/sync@0.5.0.rbi +8 -0
- data/sorbet/rbi/gems/term-ansicolor@1.7.1.rbi +8 -0
- data/sorbet/rbi/gems/thor@1.2.1.rbi +3956 -0
- data/sorbet/rbi/gems/thread_safe@0.3.6.rbi +8 -0
- data/sorbet/rbi/gems/timecop@0.9.6.rbi +361 -0
- data/sorbet/rbi/gems/tins@1.32.1.rbi +8 -0
- data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5917 -0
- data/sorbet/rbi/gems/unicode-display_width@2.4.2.rbi +8 -0
- data/sorbet/rbi/gems/unparser@0.6.7.rbi +4515 -0
- data/sorbet/rbi/gems/webrick@1.7.0.rbi +2553 -0
- data/sorbet/rbi/gems/yard@0.9.28.rbi +17954 -0
- data/sorbet/rbi/gems/zeitwerk@2.6.7.rbi +966 -0
- data/sorbet/rbi/models/acts-as-messageable/message.rbi +668 -0
- data/sorbet/rbi/models/acts-as-messageable/user.rbi +343 -0
- data/sorbet/rbi/rails-rbi/active_record_base.rbi +119 -0
- data/sorbet/rbi/rails-rbi/active_record_relation.rbi +180 -0
- data/sorbet/rbi/shims/activerecord.rbi +4 -0
- data/sorbet/rbi/shims/model.rbi +9 -0
- data/sorbet/tapioca/config.yml +10 -0
- data/sorbet/tapioca/pre_require.rb +5 -0
- data/sorbet/tapioca/require.rb +10 -0
- data/spec/acts_as_messageable_spec.rb +7 -4
- data/spec/custom_class_spec.rb +1 -0
- data/spec/custom_required_spec.rb +8 -4
- data/spec/group_messages_spec.rb +1 -0
- data/spec/migrations_spec.rb +2 -1
- data/spec/spec_helper.rb +19 -9
- data/spec/support/admin.rb +3 -0
- data/spec/support/custom_message.rb +3 -0
- data/spec/support/custom_message_uuid.rb +1 -0
- data/spec/support/custom_search_user.rb +3 -0
- data/spec/support/men.rb +1 -0
- data/spec/support/send_message.rb +8 -1
- data/spec/support/table_schema.rb +7 -6
- data/spec/support/user.rb +3 -0
- data/spec/support/uuid_user.rb +3 -0
- data/tasks/types.rake +46 -0
- metadata +261 -11
- data/.travis.yml +0 -55
@@ -0,0 +1,8 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for types exported from the `thread_safe` gem.
|
5
|
+
# Please instead update this file by running `bin/tapioca gem thread_safe`.
|
6
|
+
|
7
|
+
# THIS IS AN EMPTY RBI FILE.
|
8
|
+
# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem
|
@@ -0,0 +1,361 @@
|
|
1
|
+
# typed: false
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for types exported from the `timecop` gem.
|
5
|
+
# Please instead update this file by running `bin/tapioca gem timecop`.
|
6
|
+
|
7
|
+
# source://timecop//lib/timecop/time_extensions.rb#31
|
8
|
+
class Date
|
9
|
+
include ::Comparable
|
10
|
+
|
11
|
+
class << self
|
12
|
+
# source://timecop//lib/timecop/time_extensions.rb#104
|
13
|
+
def closest_wday(wday); end
|
14
|
+
|
15
|
+
# source://timecop//lib/timecop/time_extensions.rb#33
|
16
|
+
def mock_date; end
|
17
|
+
|
18
|
+
# source://timecop//lib/timecop/time_extensions.rb#100
|
19
|
+
def mocked_time_stack_item; end
|
20
|
+
|
21
|
+
# source://timecop//lib/timecop/time_extensions.rb#78
|
22
|
+
def parse(*args); end
|
23
|
+
|
24
|
+
# source://timecop//lib/timecop/time_extensions.rb#78
|
25
|
+
def parse_with_mock_date(*args); end
|
26
|
+
|
27
|
+
# source://timecop//lib/timecop/time_extensions.rb#47
|
28
|
+
def strptime(str = T.unsafe(nil), fmt = T.unsafe(nil), start = T.unsafe(nil)); end
|
29
|
+
|
30
|
+
# source://timecop//lib/timecop/time_extensions.rb#47
|
31
|
+
def strptime_with_mock_date(str = T.unsafe(nil), fmt = T.unsafe(nil), start = T.unsafe(nil)); end
|
32
|
+
|
33
|
+
# source://timecop//lib/timecop/time_extensions.rb#39
|
34
|
+
def today; end
|
35
|
+
|
36
|
+
# source://timecop//lib/timecop/time_extensions.rb#39
|
37
|
+
def today_with_mock_date; end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
# source://activesupport/7.0.4.1/lib/active_support/core_ext/date/conversions.rb#9
|
42
|
+
Date::DATE_FORMATS = T.let(T.unsafe(nil), Hash)
|
43
|
+
|
44
|
+
# source://activesupport/7.0.4.1/lib/active_support/core_ext/date/deprecated_conversions.rb#6
|
45
|
+
Date::NOT_SET = T.let(T.unsafe(nil), Object)
|
46
|
+
|
47
|
+
# source://date/3.2.2/date.rb#7
|
48
|
+
Date::VERSION = T.let(T.unsafe(nil), String)
|
49
|
+
|
50
|
+
# source://timecop//lib/timecop/time_extensions.rb#113
|
51
|
+
class DateTime < ::Date
|
52
|
+
class << self
|
53
|
+
# source://timecop//lib/timecop/time_extensions.rb#115
|
54
|
+
def mock_time; end
|
55
|
+
|
56
|
+
# source://timecop//lib/timecop/time_extensions.rb#150
|
57
|
+
def mocked_time_stack_item; end
|
58
|
+
|
59
|
+
# source://timecop//lib/timecop/time_extensions.rb#119
|
60
|
+
def now; end
|
61
|
+
|
62
|
+
# source://timecop//lib/timecop/time_extensions.rb#119
|
63
|
+
def now_with_mock_time; end
|
64
|
+
|
65
|
+
# source://timecop//lib/timecop/time_extensions.rb#127
|
66
|
+
def parse(*args); end
|
67
|
+
|
68
|
+
# source://timecop//lib/timecop/time_extensions.rb#127
|
69
|
+
def parse_with_mock_date(*args); end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
# source://activesupport/7.0.4.1/lib/active_support/core_ext/date_time/deprecated_conversions.rb#6
|
74
|
+
DateTime::NOT_SET = T.let(T.unsafe(nil), Object)
|
75
|
+
|
76
|
+
# source://timecop//lib/timecop/time_extensions.rb#4
|
77
|
+
class Time
|
78
|
+
include ::Comparable
|
79
|
+
|
80
|
+
class << self
|
81
|
+
# source://timecop//lib/timecop/time_extensions.rb#6
|
82
|
+
def mock_time; end
|
83
|
+
|
84
|
+
# source://timecop//lib/timecop/time_extensions.rb#21
|
85
|
+
def new(*args, **_arg1); end
|
86
|
+
|
87
|
+
# source://timecop//lib/timecop/time_extensions.rb#21
|
88
|
+
def new_with_mock_time(*args, **_arg1); end
|
89
|
+
|
90
|
+
# source://timecop//lib/timecop/time_extensions.rb#13
|
91
|
+
def now; end
|
92
|
+
|
93
|
+
# source://timecop//lib/timecop/time_extensions.rb#13
|
94
|
+
def now_with_mock_time; end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
# source://activesupport/7.0.4.1/lib/active_support/core_ext/time/calculations.rb#14
|
99
|
+
Time::COMMON_YEAR_DAYS_IN_MONTH = T.let(T.unsafe(nil), Array)
|
100
|
+
|
101
|
+
# source://activesupport/7.0.4.1/lib/active_support/core_ext/time/conversions.rb#8
|
102
|
+
Time::DATE_FORMATS = T.let(T.unsafe(nil), Hash)
|
103
|
+
|
104
|
+
# source://activesupport/7.0.4.1/lib/active_support/core_ext/time/deprecated_conversions.rb#6
|
105
|
+
Time::NOT_SET = T.let(T.unsafe(nil), Object)
|
106
|
+
|
107
|
+
# Timecop
|
108
|
+
# * Wrapper class for manipulating the extensions to the Time, Date, and DateTime objects
|
109
|
+
# * Allows us to "freeze" time in our Ruby applications.
|
110
|
+
# * Optionally allows time travel to simulate a running clock, such time is not technically frozen.
|
111
|
+
#
|
112
|
+
# This is very useful when your app's functionality is dependent on time (e.g.
|
113
|
+
# anything that might expire). This will allow us to alter the return value of
|
114
|
+
# Date.today, Time.now, and DateTime.now, such that our application code _never_ has to change.
|
115
|
+
#
|
116
|
+
# source://timecop//lib/timecop/time_stack_item.rb#1
|
117
|
+
class Timecop
|
118
|
+
include ::Singleton
|
119
|
+
extend ::Singleton::SingletonClassMethods
|
120
|
+
|
121
|
+
# @return [Timecop] a new instance of Timecop
|
122
|
+
#
|
123
|
+
# source://timecop//lib/timecop/timecop.rb#174
|
124
|
+
def initialize; end
|
125
|
+
|
126
|
+
# source://timecop//lib/timecop/timecop.rb#141
|
127
|
+
def baseline; end
|
128
|
+
|
129
|
+
# source://timecop//lib/timecop/timecop.rb#136
|
130
|
+
def baseline=(b); end
|
131
|
+
|
132
|
+
# source://timecop//lib/timecop/timecop.rb#209
|
133
|
+
def return(&block); end
|
134
|
+
|
135
|
+
# source://timecop//lib/timecop/timecop.rb#224
|
136
|
+
def return_to_baseline; end
|
137
|
+
|
138
|
+
# source://timecop//lib/timecop/timecop.rb#149
|
139
|
+
def set_baseline(b); end
|
140
|
+
|
141
|
+
# source://timecop//lib/timecop/timecop.rb#166
|
142
|
+
def set_stack(s); end
|
143
|
+
|
144
|
+
# source://timecop//lib/timecop/timecop.rb#157
|
145
|
+
def stack; end
|
146
|
+
|
147
|
+
# source://timecop//lib/timecop/timecop.rb#185
|
148
|
+
def thread_safe; end
|
149
|
+
|
150
|
+
# source://timecop//lib/timecop/timecop.rb#180
|
151
|
+
def thread_safe=(t); end
|
152
|
+
|
153
|
+
# @raise [SafeModeException]
|
154
|
+
#
|
155
|
+
# source://timecop//lib/timecop/timecop.rb#189
|
156
|
+
def travel(mock_type, *args, &block); end
|
157
|
+
|
158
|
+
# source://timecop//lib/timecop/timecop.rb#219
|
159
|
+
def unmock!; end
|
160
|
+
|
161
|
+
class << self
|
162
|
+
# source://timecop//lib/timecop/timecop.rb#78
|
163
|
+
def baseline; end
|
164
|
+
|
165
|
+
# source://timecop//lib/timecop/timecop.rb#82
|
166
|
+
def baseline=(baseline); end
|
167
|
+
|
168
|
+
# Allows you to run a block of code and "fake" a time throughout the execution of that block.
|
169
|
+
# This is particularly useful for writing test methods where the passage of time is critical to the business
|
170
|
+
# logic being tested. For example:
|
171
|
+
#
|
172
|
+
# joe = User.find(1)
|
173
|
+
# joe.purchase_home()
|
174
|
+
# assert !joe.mortgage_due?
|
175
|
+
# Timecop.freeze(2008, 10, 5) do
|
176
|
+
# assert joe.mortgage_due?
|
177
|
+
# end
|
178
|
+
#
|
179
|
+
# freeze and travel will respond to several different arguments:
|
180
|
+
# 1. Timecop.freeze(time_inst)
|
181
|
+
# 2. Timecop.freeze(datetime_inst)
|
182
|
+
# 3. Timecop.freeze(date_inst)
|
183
|
+
# 4. Timecop.freeze(offset_in_seconds)
|
184
|
+
# 5. Timecop.freeze(year, month, day, hour=0, minute=0, second=0)
|
185
|
+
# 6. Timecop.freeze() # Defaults to Time.now
|
186
|
+
#
|
187
|
+
# When a block is also passed, Time.now, DateTime.now and Date.today are all reset to their
|
188
|
+
# previous values after the block has finished executing. This allows us to nest multiple
|
189
|
+
# calls to Timecop.travel and have each block maintain it's concept of "now."
|
190
|
+
#
|
191
|
+
# * Note: Timecop.freeze will actually freeze time. This can cause unanticipated problems if
|
192
|
+
# benchmark or other timing calls are executed, which implicitly expect Time to actually move
|
193
|
+
# forward.
|
194
|
+
#
|
195
|
+
# * Rails Users: Be especially careful when setting this in your development environment in a
|
196
|
+
# rails project. Generators will load your environment, including the migration generator,
|
197
|
+
# which will lead to files being generated with the timestamp set by the Timecop.freeze call
|
198
|
+
# in your dev environment
|
199
|
+
#
|
200
|
+
# Returns the value of the block if one is given, or the mocked time.
|
201
|
+
#
|
202
|
+
# source://timecop//lib/timecop/timecop.rb#51
|
203
|
+
def freeze(*args, &block); end
|
204
|
+
|
205
|
+
# Returns whether or not Timecop is currently frozen/travelled
|
206
|
+
#
|
207
|
+
# @return [Boolean]
|
208
|
+
#
|
209
|
+
# source://timecop//lib/timecop/timecop.rb#125
|
210
|
+
def frozen?; end
|
211
|
+
|
212
|
+
# Reverts back to system's Time.now, Date.today and DateTime.now (if it exists) permamently when
|
213
|
+
# no block argument is given, or temporarily reverts back to the system's time temporarily for
|
214
|
+
# the given block.
|
215
|
+
#
|
216
|
+
# source://timecop//lib/timecop/timecop.rb#89
|
217
|
+
def return(&block); end
|
218
|
+
|
219
|
+
# source://timecop//lib/timecop/timecop.rb#99
|
220
|
+
def return_to_baseline; end
|
221
|
+
|
222
|
+
# source://timecop//lib/timecop/timecop.rb#108
|
223
|
+
def safe_mode=(safe); end
|
224
|
+
|
225
|
+
# @return [Boolean]
|
226
|
+
#
|
227
|
+
# source://timecop//lib/timecop/timecop.rb#112
|
228
|
+
def safe_mode?; end
|
229
|
+
|
230
|
+
# Allows you to run a block of code and "scale" a time throughout the execution of that block.
|
231
|
+
# The first argument is a scaling factor, for example:
|
232
|
+
# Timecop.scale(2) do
|
233
|
+
# ... time will 'go' twice as fast here
|
234
|
+
# end
|
235
|
+
# See Timecop#freeze for exact usage of the other arguments
|
236
|
+
#
|
237
|
+
# Returns the value of the block if one is given, or the mocked time.
|
238
|
+
#
|
239
|
+
# source://timecop//lib/timecop/timecop.rb#74
|
240
|
+
def scale(*args, &block); end
|
241
|
+
|
242
|
+
# source://timecop//lib/timecop/timecop.rb#120
|
243
|
+
def thread_safe; end
|
244
|
+
|
245
|
+
# source://timecop//lib/timecop/timecop.rb#116
|
246
|
+
def thread_safe=(t); end
|
247
|
+
|
248
|
+
# source://timecop//lib/timecop/timecop.rb#104
|
249
|
+
def top_stack_item; end
|
250
|
+
|
251
|
+
# Allows you to run a block of code and "fake" a time throughout the execution of that block.
|
252
|
+
# See Timecop#freeze for a sample of how to use (same exact usage syntax)
|
253
|
+
#
|
254
|
+
# * Note: Timecop.travel will not freeze time (as opposed to Timecop.freeze). This is a particularly
|
255
|
+
# good candidate for use in environment files in rails projects.
|
256
|
+
#
|
257
|
+
# Returns the value of the block if one is given, or the mocked time.
|
258
|
+
#
|
259
|
+
# source://timecop//lib/timecop/timecop.rb#62
|
260
|
+
def travel(*args, &block); end
|
261
|
+
|
262
|
+
# Reverts back to system's Time.now, Date.today and DateTime.now (if it exists) permamently when
|
263
|
+
# no block argument is given, or temporarily reverts back to the system's time temporarily for
|
264
|
+
# the given block.
|
265
|
+
#
|
266
|
+
# source://timecop//lib/timecop/timecop.rb#89
|
267
|
+
def unfreeze(&block); end
|
268
|
+
|
269
|
+
private
|
270
|
+
|
271
|
+
# source://timecop//lib/timecop/timecop.rb#130
|
272
|
+
def send_travel(mock_type, *args, &block); end
|
273
|
+
end
|
274
|
+
end
|
275
|
+
|
276
|
+
# source://timecop//lib/timecop/timecop.rb#232
|
277
|
+
class Timecop::SafeModeException < ::StandardError
|
278
|
+
# @return [SafeModeException] a new instance of SafeModeException
|
279
|
+
#
|
280
|
+
# source://timecop//lib/timecop/timecop.rb#233
|
281
|
+
def initialize; end
|
282
|
+
end
|
283
|
+
|
284
|
+
# A data class for carrying around "time movement" objects. Makes it easy to keep track of the time
|
285
|
+
# movements on a simple stack.
|
286
|
+
#
|
287
|
+
# source://timecop//lib/timecop/time_stack_item.rb#4
|
288
|
+
class Timecop::TimeStackItem
|
289
|
+
# @return [TimeStackItem] a new instance of TimeStackItem
|
290
|
+
#
|
291
|
+
# source://timecop//lib/timecop/time_stack_item.rb#7
|
292
|
+
def initialize(mock_type, *args); end
|
293
|
+
|
294
|
+
# source://timecop//lib/timecop/time_stack_item.rb#77
|
295
|
+
def date(date_klass = T.unsafe(nil)); end
|
296
|
+
|
297
|
+
# source://timecop//lib/timecop/time_stack_item.rb#81
|
298
|
+
def datetime(datetime_klass = T.unsafe(nil)); end
|
299
|
+
|
300
|
+
# source://timecop//lib/timecop/time_stack_item.rb#25
|
301
|
+
def day; end
|
302
|
+
|
303
|
+
# source://timecop//lib/timecop/time_stack_item.rb#29
|
304
|
+
def hour; end
|
305
|
+
|
306
|
+
# source://timecop//lib/timecop/time_stack_item.rb#33
|
307
|
+
def min; end
|
308
|
+
|
309
|
+
# source://timecop//lib/timecop/time_stack_item.rb#5
|
310
|
+
def mock_type; end
|
311
|
+
|
312
|
+
# source://timecop//lib/timecop/time_stack_item.rb#21
|
313
|
+
def month; end
|
314
|
+
|
315
|
+
# source://timecop//lib/timecop/time_stack_item.rb#73
|
316
|
+
def scaled_time; end
|
317
|
+
|
318
|
+
# source://timecop//lib/timecop/time_stack_item.rb#53
|
319
|
+
def scaling_factor; end
|
320
|
+
|
321
|
+
# source://timecop//lib/timecop/time_stack_item.rb#37
|
322
|
+
def sec; end
|
323
|
+
|
324
|
+
# source://timecop//lib/timecop/time_stack_item.rb#57
|
325
|
+
def time(time_klass = T.unsafe(nil)); end
|
326
|
+
|
327
|
+
# source://timecop//lib/timecop/time_stack_item.rb#45
|
328
|
+
def travel_offset; end
|
329
|
+
|
330
|
+
# source://timecop//lib/timecop/time_stack_item.rb#49
|
331
|
+
def travel_offset_days; end
|
332
|
+
|
333
|
+
# source://timecop//lib/timecop/time_stack_item.rb#41
|
334
|
+
def utc_offset; end
|
335
|
+
|
336
|
+
# source://timecop//lib/timecop/time_stack_item.rb#17
|
337
|
+
def year; end
|
338
|
+
|
339
|
+
private
|
340
|
+
|
341
|
+
# source://timecop//lib/timecop/time_stack_item.rb#128
|
342
|
+
def compute_travel_offset; end
|
343
|
+
|
344
|
+
# source://timecop//lib/timecop/time_stack_item.rb#100
|
345
|
+
def parse_time(*args); end
|
346
|
+
|
347
|
+
# source://timecop//lib/timecop/time_stack_item.rb#92
|
348
|
+
def rational_to_utc_offset(rational); end
|
349
|
+
|
350
|
+
# source://timecop//lib/timecop/time_stack_item.rb#136
|
351
|
+
def time_klass; end
|
352
|
+
|
353
|
+
# source://timecop//lib/timecop/time_stack_item.rb#132
|
354
|
+
def times_are_equal_within_epsilon(t1, t2, epsilon_in_seconds); end
|
355
|
+
|
356
|
+
# source://timecop//lib/timecop/time_stack_item.rb#96
|
357
|
+
def utc_offset_to_rational(utc_offset); end
|
358
|
+
end
|
359
|
+
|
360
|
+
# source://timecop//lib/timecop/version.rb#2
|
361
|
+
Timecop::VERSION = T.let(T.unsafe(nil), String)
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for types exported from the `tins` gem.
|
5
|
+
# Please instead update this file by running `bin/tapioca gem tins`.
|
6
|
+
|
7
|
+
# THIS IS AN EMPTY RBI FILE.
|
8
|
+
# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem
|