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.
Files changed (214) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +8 -0
  3. data/.github/workflows/test.yml +152 -0
  4. data/.rubocop.yml +14 -1
  5. data/.rubocop_todo.yml +49 -7
  6. data/.ruby-version +1 -0
  7. data/Appraisals +11 -0
  8. data/Dockerfile +2 -1
  9. data/Gemfile +19 -13
  10. data/Gemfile.lock +186 -97
  11. data/README.md +2 -3
  12. data/Rakefile +6 -1
  13. data/VERSION +1 -1
  14. data/acts-as-messageable.gemspec +193 -40
  15. data/bin/tapioca +29 -0
  16. data/docker-compose.yml +82 -71
  17. data/gemfiles/rails_3.2.gemfile +14 -9
  18. data/gemfiles/rails_4.2.gemfile +14 -9
  19. data/gemfiles/rails_5.2.gemfile +14 -9
  20. data/gemfiles/rails_6.0.gemfile +14 -9
  21. data/gemfiles/rails_7.0.gemfile +29 -0
  22. data/gemfiles/rails_master.gemfile +15 -9
  23. data/lib/acts-as-messageable.rb +1 -0
  24. data/lib/acts_as_messageable/message.rb +62 -5
  25. data/lib/acts_as_messageable/model.rb +71 -20
  26. data/lib/acts_as_messageable/rails3.rb +27 -2
  27. data/lib/acts_as_messageable/rails4.rb +31 -4
  28. data/lib/acts_as_messageable/rails6.rb +34 -2
  29. data/lib/acts_as_messageable/railtie.rb +1 -0
  30. data/lib/acts_as_messageable/relation.rb +18 -2
  31. data/lib/acts_as_messageable/scopes.rb +11 -0
  32. data/lib/acts_as_messageable.rb +18 -0
  33. data/lib/generators/acts_as_messageable/migration/migration_generator.rb +4 -0
  34. data/lib/generators/acts_as_messageable/migration/templates/migration.rb +1 -0
  35. data/lib/generators/acts_as_messageable/migration/templates/migration_indexes.rb +1 -0
  36. data/lib/generators/acts_as_messageable/migration/templates/migration_opened_as_datetime.rb +1 -0
  37. data/lib/generators/acts_as_messageable/migration/templates/migration_permanent.rb +1 -0
  38. data/sorbet/config +4 -0
  39. data/sorbet/rbi/annotations/actionpack.rbi +428 -0
  40. data/sorbet/rbi/annotations/actionview.rbi +77 -0
  41. data/sorbet/rbi/annotations/activerecord.rbi +18 -0
  42. data/sorbet/rbi/annotations/activesupport.rbi +52 -0
  43. data/sorbet/rbi/annotations/faraday.rbi +17 -0
  44. data/sorbet/rbi/annotations/railties.rbi +58 -0
  45. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  46. data/sorbet/rbi/dsl/abstract_controller/caching/fragments.rbi +23 -0
  47. data/sorbet/rbi/dsl/abstract_controller/caching.rbi +30 -0
  48. data/sorbet/rbi/dsl/abstract_controller/callbacks.rbi +23 -0
  49. data/sorbet/rbi/dsl/abstract_controller/helpers.rbi +23 -0
  50. data/sorbet/rbi/dsl/abstract_controller/rendering.rbi +9 -0
  51. data/sorbet/rbi/dsl/abstract_controller/url_for.rbi +23 -0
  52. data/sorbet/rbi/dsl/action_controller/caching.rbi +29 -0
  53. data/sorbet/rbi/dsl/action_controller/conditional_get.rbi +23 -0
  54. data/sorbet/rbi/dsl/action_controller/content_security_policy.rbi +31 -0
  55. data/sorbet/rbi/dsl/action_controller/data_streaming.rbi +9 -0
  56. data/sorbet/rbi/dsl/action_controller/etag_with_flash.rbi +24 -0
  57. data/sorbet/rbi/dsl/action_controller/etag_with_template_digest.rbi +30 -0
  58. data/sorbet/rbi/dsl/action_controller/flash.rbi +19 -0
  59. data/sorbet/rbi/dsl/action_controller/form_builder.rbi +19 -0
  60. data/sorbet/rbi/dsl/action_controller/helpers.rbi +36 -0
  61. data/sorbet/rbi/dsl/action_controller/params_wrapper.rbi +23 -0
  62. data/sorbet/rbi/dsl/action_controller/redirecting.rbi +24 -0
  63. data/sorbet/rbi/dsl/action_controller/renderers/all.rbi +24 -0
  64. data/sorbet/rbi/dsl/action_controller/renderers.rbi +23 -0
  65. data/sorbet/rbi/dsl/action_controller/request_forgery_protection.rbi +31 -0
  66. data/sorbet/rbi/dsl/action_controller/rescue.rbi +24 -0
  67. data/sorbet/rbi/dsl/action_controller/test_case/behavior.rbi +24 -0
  68. data/sorbet/rbi/dsl/action_controller/url_for.rbi +24 -0
  69. data/sorbet/rbi/dsl/action_dispatch/routing/url_for.rbi +23 -0
  70. data/sorbet/rbi/dsl/action_view/helpers/form_helper.rbi +10 -0
  71. data/sorbet/rbi/dsl/action_view/helpers/form_tag_helper.rbi +10 -0
  72. data/sorbet/rbi/dsl/action_view/helpers/text_helper.rbi +9 -0
  73. data/sorbet/rbi/dsl/action_view/helpers.rbi +10 -0
  74. data/sorbet/rbi/dsl/action_view/layouts.rbi +24 -0
  75. data/sorbet/rbi/dsl/action_view/rendering.rbi +9 -0
  76. data/sorbet/rbi/dsl/active_model/attribute_methods.rbi +27 -0
  77. data/sorbet/rbi/dsl/active_model/attributes.rbi +34 -0
  78. data/sorbet/rbi/dsl/active_model/dirty.rbi +28 -0
  79. data/sorbet/rbi/dsl/active_model/serializers/json.rbi +22 -0
  80. data/sorbet/rbi/dsl/active_model/validations/callbacks.rbi +22 -0
  81. data/sorbet/rbi/dsl/active_model/validations.rbi +27 -0
  82. data/sorbet/rbi/dsl/active_record/attribute_methods/dirty.rbi +38 -0
  83. data/sorbet/rbi/dsl/active_record/attribute_methods/time_zone_conversion.rbi +32 -0
  84. data/sorbet/rbi/dsl/active_record/attribute_methods.rbi +53 -0
  85. data/sorbet/rbi/dsl/active_record/attributes.rbi +19 -0
  86. data/sorbet/rbi/dsl/active_record/callbacks.rbi +22 -0
  87. data/sorbet/rbi/dsl/active_record/core.rbi +55 -0
  88. data/sorbet/rbi/dsl/active_record/encryption/encryptable_record.rbi +23 -0
  89. data/sorbet/rbi/dsl/active_record/inheritance.rbi +27 -0
  90. data/sorbet/rbi/dsl/active_record/integration.rbi +32 -0
  91. data/sorbet/rbi/dsl/active_record/locking/optimistic.rbi +22 -0
  92. data/sorbet/rbi/dsl/active_record/model_schema.rbi +52 -0
  93. data/sorbet/rbi/dsl/active_record/nested_attributes.rbi +22 -0
  94. data/sorbet/rbi/dsl/active_record/readonly_attributes.rbi +19 -0
  95. data/sorbet/rbi/dsl/active_record/reflection.rbi +32 -0
  96. data/sorbet/rbi/dsl/active_record/scoping/default.rbi +23 -0
  97. data/sorbet/rbi/dsl/active_record/scoping.rbi +23 -0
  98. data/sorbet/rbi/dsl/active_record/serialization.rbi +22 -0
  99. data/sorbet/rbi/dsl/active_record/signed_id.rbi +22 -0
  100. data/sorbet/rbi/dsl/active_record/test_fixtures.rbi +58 -0
  101. data/sorbet/rbi/dsl/active_record/timestamp.rbi +23 -0
  102. data/sorbet/rbi/dsl/active_record/validations.rbi +28 -0
  103. data/sorbet/rbi/dsl/active_support/actionable_error.rbi +23 -0
  104. data/sorbet/rbi/dsl/active_support/callbacks.rbi +22 -0
  105. data/sorbet/rbi/dsl/active_support/rescuable.rbi +23 -0
  106. data/sorbet/rbi/dsl/active_support/testing/file_fixtures.rbi +22 -0
  107. data/sorbet/rbi/gems/actionpack@7.0.4.3.rbi +19265 -0
  108. data/sorbet/rbi/gems/actionview@7.0.4.3.rbi +15482 -0
  109. data/sorbet/rbi/gems/activemodel@7.0.4.3.rbi +6025 -0
  110. data/sorbet/rbi/gems/activerecord@7.0.4.3.rbi +37852 -0
  111. data/sorbet/rbi/gems/activesupport@7.0.4.3.rbi +18788 -0
  112. data/sorbet/rbi/gems/addressable@2.4.0.rbi +8 -0
  113. data/sorbet/rbi/gems/appraisal@2.4.1.rbi +584 -0
  114. data/sorbet/rbi/gems/ast@2.4.2.rbi +584 -0
  115. data/sorbet/rbi/gems/builder@3.2.4.rbi +8 -0
  116. data/sorbet/rbi/gems/coderay@1.1.3.rbi +3426 -0
  117. data/sorbet/rbi/gems/commander@4.6.0.rbi +8 -0
  118. data/sorbet/rbi/gems/concurrent-ruby@1.2.2.rbi +11545 -0
  119. data/sorbet/rbi/gems/coveralls_reborn@0.27.0.rbi +8 -0
  120. data/sorbet/rbi/gems/crass@1.0.6.rbi +622 -0
  121. data/sorbet/rbi/gems/descendants_tracker@0.0.4.rbi +8 -0
  122. data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +1079 -0
  123. data/sorbet/rbi/gems/docile@1.4.0.rbi +8 -0
  124. data/sorbet/rbi/gems/erubi@1.12.0.rbi +146 -0
  125. data/sorbet/rbi/gems/faraday@0.9.2.rbi +964 -0
  126. data/sorbet/rbi/gems/git@1.11.0.rbi +2700 -0
  127. data/sorbet/rbi/gems/github_api@0.16.0.rbi +8 -0
  128. data/sorbet/rbi/gems/hashie@5.0.0.rbi +8 -0
  129. data/sorbet/rbi/gems/highline@2.0.3.rbi +8 -0
  130. data/sorbet/rbi/gems/i18n@1.12.0.rbi +2296 -0
  131. data/sorbet/rbi/gems/jeweler@2.3.9.rbi +1591 -0
  132. data/sorbet/rbi/gems/json@2.6.3.rbi +1541 -0
  133. data/sorbet/rbi/gems/jwt@2.5.0.rbi +8 -0
  134. data/sorbet/rbi/gems/loofah@2.19.1.rbi +904 -0
  135. data/sorbet/rbi/gems/method_source@1.0.0.rbi +272 -0
  136. data/sorbet/rbi/gems/mime-types@2.99.3.rbi +8 -0
  137. data/sorbet/rbi/gems/minitest@5.18.0.rbi +1491 -0
  138. data/sorbet/rbi/gems/multi_json@1.15.0.rbi +8 -0
  139. data/sorbet/rbi/gems/multi_xml@0.6.0.rbi +8 -0
  140. data/sorbet/rbi/gems/multipart-post@2.2.3.rbi +8 -0
  141. data/sorbet/rbi/gems/netrc@0.11.0.rbi +158 -0
  142. data/sorbet/rbi/gems/nokogiri@1.14.2.rbi +7244 -0
  143. data/sorbet/rbi/gems/oauth2@1.4.8.rbi +8 -0
  144. data/sorbet/rbi/gems/parallel@1.22.1.rbi +277 -0
  145. data/sorbet/rbi/gems/pg@1.4.6.rbi +2574 -0
  146. data/sorbet/rbi/gems/polyfill@1.9.0.rbi +8 -0
  147. data/sorbet/rbi/gems/pry@0.14.2.rbi +10081 -0
  148. data/sorbet/rbi/gems/psych@4.0.6.rbi +1819 -0
  149. data/sorbet/rbi/gems/racc@1.6.2.rbi +155 -0
  150. data/sorbet/rbi/gems/rack-test@2.0.2.rbi +943 -0
  151. data/sorbet/rbi/gems/rack@2.2.6.4.rbi +5659 -0
  152. data/sorbet/rbi/gems/rails-dom-testing@2.0.3.rbi +455 -0
  153. data/sorbet/rbi/gems/rails-html-sanitizer@1.5.0.rbi +685 -0
  154. data/sorbet/rbi/gems/railties@7.0.4.3.rbi +4553 -0
  155. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +8 -0
  156. data/sorbet/rbi/gems/rake@13.0.6.rbi +2959 -0
  157. data/sorbet/rbi/gems/rbi@0.0.16.rbi +3008 -0
  158. data/sorbet/rbi/gems/rbs@2.8.0.rbi +8 -0
  159. data/sorbet/rbi/gems/rchardet@1.8.0.rbi +1078 -0
  160. data/sorbet/rbi/gems/rdoc@6.5.0.rbi +12441 -0
  161. data/sorbet/rbi/gems/regexp_parser@2.7.0.rbi +8 -0
  162. data/sorbet/rbi/gems/rexml@3.2.5.rbi +8 -0
  163. data/sorbet/rbi/gems/rspec-core@3.12.0.rbi +10798 -0
  164. data/sorbet/rbi/gems/rspec-expectations@3.12.0.rbi +8090 -0
  165. data/sorbet/rbi/gems/rspec-mocks@3.12.0.rbi +5296 -0
  166. data/sorbet/rbi/gems/rspec-support@3.12.0.rbi +1617 -0
  167. data/sorbet/rbi/gems/rspec@3.12.0.rbi +88 -0
  168. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +8 -0
  169. data/sorbet/rbi/gems/safe_type@1.1.1.rbi +8 -0
  170. data/sorbet/rbi/gems/semver2@3.4.2.rbi +8 -0
  171. data/sorbet/rbi/gems/simplecov-html@0.12.3.rbi +8 -0
  172. data/sorbet/rbi/gems/simplecov@0.22.0.rbi +8 -0
  173. data/sorbet/rbi/gems/simplecov_json_formatter@0.1.4.rbi +8 -0
  174. data/sorbet/rbi/gems/sorbet-coerce@0.7.0.rbi +8 -0
  175. data/sorbet/rbi/gems/stringio@3.0.2.rbi +8 -0
  176. data/sorbet/rbi/gems/sync@0.5.0.rbi +8 -0
  177. data/sorbet/rbi/gems/term-ansicolor@1.7.1.rbi +8 -0
  178. data/sorbet/rbi/gems/thor@1.2.1.rbi +3956 -0
  179. data/sorbet/rbi/gems/thread_safe@0.3.6.rbi +8 -0
  180. data/sorbet/rbi/gems/timecop@0.9.6.rbi +361 -0
  181. data/sorbet/rbi/gems/tins@1.32.1.rbi +8 -0
  182. data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5917 -0
  183. data/sorbet/rbi/gems/unicode-display_width@2.4.2.rbi +8 -0
  184. data/sorbet/rbi/gems/unparser@0.6.7.rbi +4515 -0
  185. data/sorbet/rbi/gems/webrick@1.7.0.rbi +2553 -0
  186. data/sorbet/rbi/gems/yard@0.9.28.rbi +17954 -0
  187. data/sorbet/rbi/gems/zeitwerk@2.6.7.rbi +966 -0
  188. data/sorbet/rbi/models/acts-as-messageable/message.rbi +668 -0
  189. data/sorbet/rbi/models/acts-as-messageable/user.rbi +343 -0
  190. data/sorbet/rbi/rails-rbi/active_record_base.rbi +119 -0
  191. data/sorbet/rbi/rails-rbi/active_record_relation.rbi +180 -0
  192. data/sorbet/rbi/shims/activerecord.rbi +4 -0
  193. data/sorbet/rbi/shims/model.rbi +9 -0
  194. data/sorbet/tapioca/config.yml +10 -0
  195. data/sorbet/tapioca/pre_require.rb +5 -0
  196. data/sorbet/tapioca/require.rb +10 -0
  197. data/spec/acts_as_messageable_spec.rb +7 -4
  198. data/spec/custom_class_spec.rb +1 -0
  199. data/spec/custom_required_spec.rb +8 -4
  200. data/spec/group_messages_spec.rb +1 -0
  201. data/spec/migrations_spec.rb +2 -1
  202. data/spec/spec_helper.rb +19 -9
  203. data/spec/support/admin.rb +3 -0
  204. data/spec/support/custom_message.rb +3 -0
  205. data/spec/support/custom_message_uuid.rb +1 -0
  206. data/spec/support/custom_search_user.rb +3 -0
  207. data/spec/support/men.rb +1 -0
  208. data/spec/support/send_message.rb +8 -1
  209. data/spec/support/table_schema.rb +7 -6
  210. data/spec/support/user.rb +3 -0
  211. data/spec/support/uuid_user.rb +3 -0
  212. data/tasks/types.rake +46 -0
  213. metadata +261 -11
  214. 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 `coveralls_reborn` gem.
5
+ # Please instead update this file by running `bin/tapioca gem coveralls_reborn`.
6
+
7
+ # THIS IS AN EMPTY RBI FILE.
8
+ # see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem
@@ -0,0 +1,622 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `crass` gem.
5
+ # Please instead update this file by running `bin/tapioca gem crass`.
6
+
7
+ # A CSS parser based on the CSS Syntax Module Level 3 spec.
8
+ #
9
+ # source://crass//lib/crass/token-scanner.rb#3
10
+ module Crass
11
+ class << self
12
+ # Parses _input_ as a CSS stylesheet and returns a parse tree.
13
+ #
14
+ # See {Tokenizer#initialize} for _options_.
15
+ #
16
+ # source://crass//lib/crass.rb#10
17
+ def parse(input, options = T.unsafe(nil)); end
18
+
19
+ # Parses _input_ as a string of CSS properties (such as the contents of an
20
+ # HTML element's `style` attribute) and returns a parse tree.
21
+ #
22
+ # See {Tokenizer#initialize} for _options_.
23
+ #
24
+ # source://crass//lib/crass.rb#18
25
+ def parse_properties(input, options = T.unsafe(nil)); end
26
+ end
27
+ end
28
+
29
+ # Parses a CSS string or list of tokens.
30
+ #
31
+ # 5. http://dev.w3.org/csswg/css-syntax/#parsing
32
+ #
33
+ # source://crass//lib/crass/parser.rb#10
34
+ class Crass::Parser
35
+ # Initializes a parser based on the given _input_, which may be a CSS string
36
+ # or an array of tokens.
37
+ #
38
+ # See {Tokenizer#initialize} for _options_.
39
+ #
40
+ # @return [Parser] a new instance of Parser
41
+ #
42
+ # source://crass//lib/crass/parser.rb#126
43
+ def initialize(input, options = T.unsafe(nil)); end
44
+
45
+ # Consumes an at-rule and returns it.
46
+ #
47
+ # 5.4.2. http://dev.w3.org/csswg/css-syntax-3/#consume-at-rule
48
+ #
49
+ # source://crass//lib/crass/parser.rb#137
50
+ def consume_at_rule(input = T.unsafe(nil)); end
51
+
52
+ # Consumes a component value and returns it, or `nil` if there are no more
53
+ # tokens.
54
+ #
55
+ # 5.4.6. http://dev.w3.org/csswg/css-syntax-3/#consume-a-component-value
56
+ #
57
+ # source://crass//lib/crass/parser.rb#184
58
+ def consume_component_value(input = T.unsafe(nil)); end
59
+
60
+ # Consumes a declaration and returns it, or `nil` on parse error.
61
+ #
62
+ # 5.4.5. http://dev.w3.org/csswg/css-syntax-3/#consume-a-declaration
63
+ #
64
+ # source://crass//lib/crass/parser.rb#209
65
+ def consume_declaration(input = T.unsafe(nil)); end
66
+
67
+ # Consumes a list of declarations and returns them.
68
+ #
69
+ # By default, the returned list may include `:comment`, `:semicolon`, and
70
+ # `:whitespace` nodes, which is non-standard.
71
+ #
72
+ # Options:
73
+ #
74
+ # * **:strict** - Set to `true` to exclude non-standard `:comment`,
75
+ # `:semicolon`, and `:whitespace` nodes.
76
+ #
77
+ # 5.4.4. http://dev.w3.org/csswg/css-syntax/#consume-a-list-of-declarations
78
+ #
79
+ # source://crass//lib/crass/parser.rb#276
80
+ def consume_declarations(input = T.unsafe(nil), options = T.unsafe(nil)); end
81
+
82
+ # Consumes a function and returns it.
83
+ #
84
+ # 5.4.8. http://dev.w3.org/csswg/css-syntax-3/#consume-a-function
85
+ #
86
+ # source://crass//lib/crass/parser.rb#326
87
+ def consume_function(input = T.unsafe(nil)); end
88
+
89
+ # Consumes a qualified rule and returns it, or `nil` if a parse error
90
+ # occurs.
91
+ #
92
+ # 5.4.3. http://dev.w3.org/csswg/css-syntax-3/#consume-a-qualified-rule
93
+ #
94
+ # source://crass//lib/crass/parser.rb#357
95
+ def consume_qualified_rule(input = T.unsafe(nil)); end
96
+
97
+ # Consumes a list of rules and returns them.
98
+ #
99
+ # 5.4.1. http://dev.w3.org/csswg/css-syntax/#consume-a-list-of-rules
100
+ #
101
+ # source://crass//lib/crass/parser.rb#398
102
+ def consume_rules(flags = T.unsafe(nil)); end
103
+
104
+ # Consumes and returns a simple block associated with the current input
105
+ # token.
106
+ #
107
+ # 5.4.7. http://dev.w3.org/csswg/css-syntax/#consume-a-simple-block
108
+ #
109
+ # source://crass//lib/crass/parser.rb#434
110
+ def consume_simple_block(input = T.unsafe(nil)); end
111
+
112
+ # Creates and returns a new parse node with the given _properties_.
113
+ #
114
+ # source://crass//lib/crass/parser.rb#458
115
+ def create_node(type, properties = T.unsafe(nil)); end
116
+
117
+ # Parses the given _input_ tokens into a selector node and returns it.
118
+ #
119
+ # Doesn't bother splitting the selector list into individual selectors or
120
+ # validating them. Feel free to do that yourself! It'll be fun!
121
+ #
122
+ # source://crass//lib/crass/parser.rb#466
123
+ def create_selector(input); end
124
+
125
+ # Creates a `:style_rule` node from the given qualified _rule_, and returns
126
+ # it.
127
+ #
128
+ # source://crass//lib/crass/parser.rb#474
129
+ def create_style_rule(rule); end
130
+
131
+ # Parses a single component value and returns it.
132
+ #
133
+ # 5.3.7. http://dev.w3.org/csswg/css-syntax-3/#parse-a-component-value
134
+ #
135
+ # source://crass//lib/crass/parser.rb#483
136
+ def parse_component_value(input = T.unsafe(nil)); end
137
+
138
+ # Parses a list of component values and returns an array of parsed tokens.
139
+ #
140
+ # 5.3.8. http://dev.w3.org/csswg/css-syntax/#parse-a-list-of-component-values
141
+ #
142
+ # source://crass//lib/crass/parser.rb#510
143
+ def parse_component_values(input = T.unsafe(nil)); end
144
+
145
+ # Parses a single declaration and returns it.
146
+ #
147
+ # 5.3.5. http://dev.w3.org/csswg/css-syntax/#parse-a-declaration
148
+ #
149
+ # source://crass//lib/crass/parser.rb#524
150
+ def parse_declaration(input = T.unsafe(nil)); end
151
+
152
+ # Parses a list of declarations and returns them.
153
+ #
154
+ # See {#consume_declarations} for _options_.
155
+ #
156
+ # 5.3.6. http://dev.w3.org/csswg/css-syntax/#parse-a-list-of-declarations
157
+ #
158
+ # source://crass//lib/crass/parser.rb#552
159
+ def parse_declarations(input = T.unsafe(nil), options = T.unsafe(nil)); end
160
+
161
+ # Parses a list of declarations and returns an array of `:property` nodes
162
+ # (and any non-declaration nodes that were in the input). This is useful for
163
+ # parsing the contents of an HTML element's `style` attribute.
164
+ #
165
+ # source://crass//lib/crass/parser.rb#560
166
+ def parse_properties(input = T.unsafe(nil)); end
167
+
168
+ # Parses a single rule and returns it.
169
+ #
170
+ # 5.3.4. http://dev.w3.org/csswg/css-syntax-3/#parse-a-rule
171
+ #
172
+ # source://crass//lib/crass/parser.rb#586
173
+ def parse_rule(input = T.unsafe(nil)); end
174
+
175
+ # Returns the unescaped value of a selector name or property declaration.
176
+ #
177
+ # source://crass//lib/crass/parser.rb#615
178
+ def parse_value(nodes); end
179
+
180
+ # {TokenScanner} wrapping the tokens generated from this parser's input.
181
+ #
182
+ # source://crass//lib/crass/parser.rb#120
183
+ def tokens; end
184
+
185
+ class << self
186
+ # Parses CSS properties (such as the contents of an HTML element's `style`
187
+ # attribute) and returns a parse tree.
188
+ #
189
+ # See {Tokenizer#initialize} for _options_.
190
+ #
191
+ # 5.3.6. http://dev.w3.org/csswg/css-syntax/#parse-a-list-of-declarations
192
+ #
193
+ # source://crass//lib/crass/parser.rb#25
194
+ def parse_properties(input, options = T.unsafe(nil)); end
195
+
196
+ # Parses CSS rules (such as the content of a `@media` block) and returns a
197
+ # parse tree. The only difference from {parse_stylesheet} is that CDO/CDC
198
+ # nodes (`<!--` and `-->`) aren't ignored.
199
+ #
200
+ # See {Tokenizer#initialize} for _options_.
201
+ #
202
+ # 5.3.3. http://dev.w3.org/csswg/css-syntax/#parse-a-list-of-rules
203
+ #
204
+ # source://crass//lib/crass/parser.rb#36
205
+ def parse_rules(input, options = T.unsafe(nil)); end
206
+
207
+ # Parses a CSS stylesheet and returns a parse tree.
208
+ #
209
+ # See {Tokenizer#initialize} for _options_.
210
+ #
211
+ # 5.3.2. http://dev.w3.org/csswg/css-syntax/#parse-a-stylesheet
212
+ #
213
+ # source://crass//lib/crass/parser.rb#54
214
+ def parse_stylesheet(input, options = T.unsafe(nil)); end
215
+
216
+ # Converts a node or array of nodes into a CSS string based on their
217
+ # original tokenized input.
218
+ #
219
+ # Options:
220
+ #
221
+ # * **:exclude_comments** - When `true`, comments will be excluded.
222
+ #
223
+ # source://crass//lib/crass/parser.rb#74
224
+ def stringify(nodes, options = T.unsafe(nil)); end
225
+ end
226
+ end
227
+
228
+ # source://crass//lib/crass/parser.rb#11
229
+ Crass::Parser::BLOCK_END_TOKENS = T.let(T.unsafe(nil), Hash)
230
+
231
+ # Similar to a StringScanner, but with extra functionality needed to tokenize
232
+ # CSS while preserving the original text.
233
+ #
234
+ # source://crass//lib/crass/scanner.rb#8
235
+ class Crass::Scanner
236
+ # Creates a Scanner instance for the given _input_ string or IO instance.
237
+ #
238
+ # @return [Scanner] a new instance of Scanner
239
+ #
240
+ # source://crass//lib/crass/scanner.rb#25
241
+ def initialize(input); end
242
+
243
+ # Consumes the next character and returns it, advancing the pointer, or
244
+ # an empty string if the end of the string has been reached.
245
+ #
246
+ # source://crass//lib/crass/scanner.rb#34
247
+ def consume; end
248
+
249
+ # Consumes the rest of the string and returns it, advancing the pointer to
250
+ # the end of the string. Returns an empty string is the end of the string
251
+ # has already been reached.
252
+ #
253
+ # source://crass//lib/crass/scanner.rb#46
254
+ def consume_rest; end
255
+
256
+ # Current character, or `nil` if the scanner hasn't yet consumed a
257
+ # character, or is at the end of the string.
258
+ #
259
+ # source://crass//lib/crass/scanner.rb#11
260
+ def current; end
261
+
262
+ # Returns `true` if the end of the string has been reached, `false`
263
+ # otherwise.
264
+ #
265
+ # @return [Boolean]
266
+ #
267
+ # source://crass//lib/crass/scanner.rb#57
268
+ def eos?; end
269
+
270
+ # Sets the marker to the position of the next character that will be
271
+ # consumed.
272
+ #
273
+ # source://crass//lib/crass/scanner.rb#63
274
+ def mark; end
275
+
276
+ # Returns the substring between {#marker} and {#pos}, without altering the
277
+ # pointer.
278
+ #
279
+ # source://crass//lib/crass/scanner.rb#69
280
+ def marked; end
281
+
282
+ # Current marker position. Use {#marked} to get the substring between
283
+ # {#marker} and {#pos}.
284
+ #
285
+ # source://crass//lib/crass/scanner.rb#15
286
+ def marker; end
287
+
288
+ # Current marker position. Use {#marked} to get the substring between
289
+ # {#marker} and {#pos}.
290
+ #
291
+ # source://crass//lib/crass/scanner.rb#15
292
+ def marker=(_arg0); end
293
+
294
+ # Returns up to _length_ characters starting at the current position, but
295
+ # doesn't consume them. The number of characters returned may be less than
296
+ # _length_ if the end of the string is reached.
297
+ #
298
+ # source://crass//lib/crass/scanner.rb#80
299
+ def peek(length = T.unsafe(nil)); end
300
+
301
+ # Position of the next character that will be consumed. This is a character
302
+ # position, not a byte position, so it accounts for multi-byte characters.
303
+ #
304
+ # source://crass//lib/crass/scanner.rb#19
305
+ def pos; end
306
+
307
+ # Position of the next character that will be consumed. This is a character
308
+ # position, not a byte position, so it accounts for multi-byte characters.
309
+ #
310
+ # source://crass//lib/crass/scanner.rb#19
311
+ def pos=(_arg0); end
312
+
313
+ # Moves the pointer back one character without changing the value of
314
+ # {#current}. The next call to {#consume} will re-consume the current
315
+ # character.
316
+ #
317
+ # source://crass//lib/crass/scanner.rb#87
318
+ def reconsume; end
319
+
320
+ # Resets the pointer to the beginning of the string.
321
+ #
322
+ # source://crass//lib/crass/scanner.rb#93
323
+ def reset; end
324
+
325
+ # Tries to match _pattern_ at the current position. If it matches, the
326
+ # matched substring will be returned and the pointer will be advanced.
327
+ # Otherwise, `nil` will be returned.
328
+ #
329
+ # source://crass//lib/crass/scanner.rb#103
330
+ def scan(pattern); end
331
+
332
+ # Scans the string until the _pattern_ is matched. Returns the substring up
333
+ # to and including the end of the match, and advances the pointer. If there
334
+ # is no match, `nil` is returned and the pointer is not advanced.
335
+ #
336
+ # source://crass//lib/crass/scanner.rb#115
337
+ def scan_until(pattern); end
338
+
339
+ # String being scanned.
340
+ #
341
+ # source://crass//lib/crass/scanner.rb#22
342
+ def string; end
343
+ end
344
+
345
+ # Like {Scanner}, but for tokens!
346
+ #
347
+ # source://crass//lib/crass/token-scanner.rb#6
348
+ class Crass::TokenScanner
349
+ # @return [TokenScanner] a new instance of TokenScanner
350
+ #
351
+ # source://crass//lib/crass/token-scanner.rb#9
352
+ def initialize(tokens); end
353
+
354
+ # Executes the given block, collects all tokens that are consumed during its
355
+ # execution, and returns them.
356
+ #
357
+ # source://crass//lib/crass/token-scanner.rb#16
358
+ def collect; end
359
+
360
+ # Consumes the next token and returns it, advancing the pointer. Returns
361
+ # `nil` if there is no next token.
362
+ #
363
+ # source://crass//lib/crass/token-scanner.rb#24
364
+ def consume; end
365
+
366
+ # Returns the value of attribute current.
367
+ #
368
+ # source://crass//lib/crass/token-scanner.rb#7
369
+ def current; end
370
+
371
+ # Returns the next token without consuming it, or `nil` if there is no next
372
+ # token.
373
+ #
374
+ # source://crass//lib/crass/token-scanner.rb#32
375
+ def peek; end
376
+
377
+ # Returns the value of attribute pos.
378
+ #
379
+ # source://crass//lib/crass/token-scanner.rb#7
380
+ def pos; end
381
+
382
+ # Reconsumes the current token, moving the pointer back one position.
383
+ #
384
+ # http://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#reconsume-the-current-input-token
385
+ #
386
+ # source://crass//lib/crass/token-scanner.rb#39
387
+ def reconsume; end
388
+
389
+ # Resets the pointer to the first token in the list.
390
+ #
391
+ # source://crass//lib/crass/token-scanner.rb#44
392
+ def reset; end
393
+
394
+ # Returns the value of attribute tokens.
395
+ #
396
+ # source://crass//lib/crass/token-scanner.rb#7
397
+ def tokens; end
398
+ end
399
+
400
+ # Tokenizes a CSS string.
401
+ #
402
+ # 4. http://dev.w3.org/csswg/css-syntax/#tokenization
403
+ #
404
+ # source://crass//lib/crass/tokenizer.rb#9
405
+ class Crass::Tokenizer
406
+ # Initializes a new Tokenizer.
407
+ #
408
+ # Options:
409
+ #
410
+ # * **:preserve_comments** - If `true`, comments will be preserved as
411
+ # `:comment` tokens.
412
+ #
413
+ # * **:preserve_hacks** - If `true`, certain non-standard browser hacks
414
+ # such as the IE "*" hack will be preserved even though they violate
415
+ # CSS 3 syntax rules.
416
+ #
417
+ # @return [Tokenizer] a new instance of Tokenizer
418
+ #
419
+ # source://crass//lib/crass/tokenizer.rb#62
420
+ def initialize(input, options = T.unsafe(nil)); end
421
+
422
+ # Consumes a token and returns the token that was consumed.
423
+ #
424
+ # 4.3.1. http://dev.w3.org/csswg/css-syntax/#consume-a-token
425
+ #
426
+ # source://crass//lib/crass/tokenizer.rb#70
427
+ def consume; end
428
+
429
+ # Consumes the remnants of a bad URL and returns the consumed text.
430
+ #
431
+ # 4.3.15. http://dev.w3.org/csswg/css-syntax/#consume-the-remnants-of-a-bad-url
432
+ #
433
+ # source://crass//lib/crass/tokenizer.rb#275
434
+ def consume_bad_url; end
435
+
436
+ # Consumes comments and returns them, or `nil` if no comments were consumed.
437
+ #
438
+ # 4.3.2. http://dev.w3.org/csswg/css-syntax/#consume-comments
439
+ #
440
+ # source://crass//lib/crass/tokenizer.rb#301
441
+ def consume_comments; end
442
+
443
+ # Consumes an escaped code point and returns its unescaped value.
444
+ #
445
+ # This method assumes that the `\` has already been consumed, and that the
446
+ # next character in the input has already been verified not to be a newline
447
+ # or EOF.
448
+ #
449
+ # 4.3.8. http://dev.w3.org/csswg/css-syntax/#consume-an-escaped-code-point
450
+ #
451
+ # source://crass//lib/crass/tokenizer.rb#326
452
+ def consume_escaped; end
453
+
454
+ # Consumes an ident-like token and returns it.
455
+ #
456
+ # 4.3.4. http://dev.w3.org/csswg/css-syntax/#consume-an-ident-like-token
457
+ #
458
+ # source://crass//lib/crass/tokenizer.rb#350
459
+ def consume_ident; end
460
+
461
+ # Consumes a name and returns it.
462
+ #
463
+ # 4.3.12. http://dev.w3.org/csswg/css-syntax/#consume-a-name
464
+ #
465
+ # source://crass//lib/crass/tokenizer.rb#375
466
+ def consume_name; end
467
+
468
+ # Consumes a number and returns a 3-element array containing the number's
469
+ # original representation, its numeric value, and its type (either
470
+ # `:integer` or `:number`).
471
+ #
472
+ # 4.3.13. http://dev.w3.org/csswg/css-syntax/#consume-a-number
473
+ #
474
+ # source://crass//lib/crass/tokenizer.rb#407
475
+ def consume_number; end
476
+
477
+ # Consumes a numeric token and returns it.
478
+ #
479
+ # 4.3.3. http://dev.w3.org/csswg/css-syntax/#consume-a-numeric-token
480
+ #
481
+ # source://crass//lib/crass/tokenizer.rb#430
482
+ def consume_numeric; end
483
+
484
+ # Consumes a string token that ends at the given character, and returns the
485
+ # token.
486
+ #
487
+ # 4.3.5. http://dev.w3.org/csswg/css-syntax/#consume-a-string-token
488
+ #
489
+ # source://crass//lib/crass/tokenizer.rb#469
490
+ def consume_string(ending = T.unsafe(nil)); end
491
+
492
+ # Consumes a Unicode range token and returns it. Assumes the initial "u+" or
493
+ # "U+" has already been consumed.
494
+ #
495
+ # 4.3.7. http://dev.w3.org/csswg/css-syntax/#consume-a-unicode-range-token
496
+ #
497
+ # source://crass//lib/crass/tokenizer.rb#510
498
+ def consume_unicode_range; end
499
+
500
+ # Consumes a URL token and returns it. Assumes the original "url(" has
501
+ # already been consumed.
502
+ #
503
+ # 4.3.6. http://dev.w3.org/csswg/css-syntax/#consume-a-url-token
504
+ #
505
+ # source://crass//lib/crass/tokenizer.rb#542
506
+ def consume_url; end
507
+
508
+ # Converts a valid CSS number string into a number and returns the number.
509
+ #
510
+ # 4.3.14. http://dev.w3.org/csswg/css-syntax/#convert-a-string-to-a-number
511
+ #
512
+ # source://crass//lib/crass/tokenizer.rb#590
513
+ def convert_string_to_number(str); end
514
+
515
+ # Creates and returns a new token with the given _properties_.
516
+ #
517
+ # source://crass//lib/crass/tokenizer.rb#616
518
+ def create_token(type, properties = T.unsafe(nil)); end
519
+
520
+ # Preprocesses _input_ to prepare it for the tokenizer.
521
+ #
522
+ # 3.3. http://dev.w3.org/csswg/css-syntax/#input-preprocessing
523
+ #
524
+ # source://crass//lib/crass/tokenizer.rb#627
525
+ def preprocess(input); end
526
+
527
+ # Returns `true` if the given three-character _text_ would start an
528
+ # identifier. If _text_ is `nil`, the current and next two characters in the
529
+ # input stream will be checked, but will not be consumed.
530
+ #
531
+ # 4.3.10. http://dev.w3.org/csswg/css-syntax/#would-start-an-identifier
532
+ #
533
+ # @return [Boolean]
534
+ #
535
+ # source://crass//lib/crass/tokenizer.rb#642
536
+ def start_identifier?(text = T.unsafe(nil)); end
537
+
538
+ # Returns `true` if the given three-character _text_ would start a number.
539
+ # If _text_ is `nil`, the current and next two characters in the input
540
+ # stream will be checked, but will not be consumed.
541
+ #
542
+ # 4.3.11. http://dev.w3.org/csswg/css-syntax/#starts-with-a-number
543
+ #
544
+ # @return [Boolean]
545
+ #
546
+ # source://crass//lib/crass/tokenizer.rb#666
547
+ def start_number?(text = T.unsafe(nil)); end
548
+
549
+ # Tokenizes the input stream and returns an array of tokens.
550
+ #
551
+ # source://crass//lib/crass/tokenizer.rb#685
552
+ def tokenize; end
553
+
554
+ # Returns `true` if the given two-character _text_ is the beginning of a
555
+ # valid escape sequence. If _text_ is `nil`, the current and next character
556
+ # in the input stream will be checked, but will not be consumed.
557
+ #
558
+ # 4.3.9. http://dev.w3.org/csswg/css-syntax/#starts-with-a-valid-escape
559
+ #
560
+ # @return [Boolean]
561
+ #
562
+ # source://crass//lib/crass/tokenizer.rb#702
563
+ def valid_escape?(text = T.unsafe(nil)); end
564
+
565
+ class << self
566
+ # Tokenizes the given _input_ as a CSS string and returns an array of
567
+ # tokens.
568
+ #
569
+ # See {#initialize} for _options_.
570
+ #
571
+ # source://crass//lib/crass/tokenizer.rb#45
572
+ def tokenize(input, options = T.unsafe(nil)); end
573
+ end
574
+ end
575
+
576
+ # source://crass//lib/crass/tokenizer.rb#10
577
+ Crass::Tokenizer::RE_COMMENT_CLOSE = T.let(T.unsafe(nil), Regexp)
578
+
579
+ # source://crass//lib/crass/tokenizer.rb#11
580
+ Crass::Tokenizer::RE_DIGIT = T.let(T.unsafe(nil), Regexp)
581
+
582
+ # source://crass//lib/crass/tokenizer.rb#12
583
+ Crass::Tokenizer::RE_ESCAPE = T.let(T.unsafe(nil), Regexp)
584
+
585
+ # source://crass//lib/crass/tokenizer.rb#13
586
+ Crass::Tokenizer::RE_HEX = T.let(T.unsafe(nil), Regexp)
587
+
588
+ # source://crass//lib/crass/tokenizer.rb#14
589
+ Crass::Tokenizer::RE_NAME = T.let(T.unsafe(nil), Regexp)
590
+
591
+ # source://crass//lib/crass/tokenizer.rb#15
592
+ Crass::Tokenizer::RE_NAME_START = T.let(T.unsafe(nil), Regexp)
593
+
594
+ # source://crass//lib/crass/tokenizer.rb#16
595
+ Crass::Tokenizer::RE_NON_PRINTABLE = T.let(T.unsafe(nil), Regexp)
596
+
597
+ # source://crass//lib/crass/tokenizer.rb#17
598
+ Crass::Tokenizer::RE_NUMBER_DECIMAL = T.let(T.unsafe(nil), Regexp)
599
+
600
+ # source://crass//lib/crass/tokenizer.rb#18
601
+ Crass::Tokenizer::RE_NUMBER_EXPONENT = T.let(T.unsafe(nil), Regexp)
602
+
603
+ # source://crass//lib/crass/tokenizer.rb#19
604
+ Crass::Tokenizer::RE_NUMBER_SIGN = T.let(T.unsafe(nil), Regexp)
605
+
606
+ # source://crass//lib/crass/tokenizer.rb#21
607
+ Crass::Tokenizer::RE_NUMBER_STR = T.let(T.unsafe(nil), Regexp)
608
+
609
+ # source://crass//lib/crass/tokenizer.rb#33
610
+ Crass::Tokenizer::RE_QUOTED_URL_START = T.let(T.unsafe(nil), Regexp)
611
+
612
+ # source://crass//lib/crass/tokenizer.rb#35
613
+ Crass::Tokenizer::RE_UNICODE_RANGE_END = T.let(T.unsafe(nil), Regexp)
614
+
615
+ # source://crass//lib/crass/tokenizer.rb#34
616
+ Crass::Tokenizer::RE_UNICODE_RANGE_START = T.let(T.unsafe(nil), Regexp)
617
+
618
+ # source://crass//lib/crass/tokenizer.rb#36
619
+ Crass::Tokenizer::RE_WHITESPACE = T.let(T.unsafe(nil), Regexp)
620
+
621
+ # source://crass//lib/crass/tokenizer.rb#37
622
+ Crass::Tokenizer::RE_WHITESPACE_ANCHORED = T.let(T.unsafe(nil), Regexp)
@@ -0,0 +1,8 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `descendants_tracker` gem.
5
+ # Please instead update this file by running `bin/tapioca gem descendants_tracker`.
6
+
7
+ # THIS IS AN EMPTY RBI FILE.
8
+ # see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem