tr8n_core 4.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +22 -0
  3. data/README.md +69 -0
  4. data/Rakefile +9 -0
  5. data/config/config.yml +34 -0
  6. data/config/tokens/data.yml +45 -0
  7. data/config/tokens/decorations.yml +37 -0
  8. data/lib/tr8n/application.rb +320 -0
  9. data/lib/tr8n/base.rb +123 -0
  10. data/lib/tr8n/cache.rb +144 -0
  11. data/lib/tr8n/cache_adapters/cdb.rb +74 -0
  12. data/lib/tr8n/cache_adapters/file.rb +70 -0
  13. data/lib/tr8n/cache_adapters/memcache.rb +91 -0
  14. data/lib/tr8n/cache_adapters/redis.rb +94 -0
  15. data/lib/tr8n/component.rb +68 -0
  16. data/lib/tr8n/config.rb +291 -0
  17. data/lib/tr8n/decorators/base.rb +35 -0
  18. data/lib/tr8n/decorators/default.rb +30 -0
  19. data/lib/tr8n/decorators/html.rb +63 -0
  20. data/lib/tr8n/exception.rb +26 -0
  21. data/lib/tr8n/language.rb +250 -0
  22. data/lib/tr8n/language_case.rb +116 -0
  23. data/lib/tr8n/language_case_rule.rb +85 -0
  24. data/lib/tr8n/language_context.rb +115 -0
  25. data/lib/tr8n/language_context_rule.rb +62 -0
  26. data/lib/tr8n/logger.rb +83 -0
  27. data/lib/tr8n/rules_engine/evaluator.rb +156 -0
  28. data/lib/tr8n/rules_engine/parser.rb +83 -0
  29. data/lib/tr8n/source.rb +95 -0
  30. data/lib/tr8n/tokens/data.rb +410 -0
  31. data/lib/tr8n/tokens/data_tokenizer.rb +82 -0
  32. data/lib/tr8n/tokens/decoration_tokenizer.rb +200 -0
  33. data/lib/tr8n/tokens/hidden.rb +48 -0
  34. data/lib/tr8n/tokens/method.rb +52 -0
  35. data/lib/tr8n/tokens/transform.rb +191 -0
  36. data/lib/tr8n/translation.rb +104 -0
  37. data/lib/tr8n/translation_key.rb +205 -0
  38. data/lib/tr8n/translator.rb +62 -0
  39. data/lib/tr8n/utils.rb +124 -0
  40. data/lib/tr8n_core/ext/array.rb +74 -0
  41. data/lib/tr8n_core/ext/date.rb +63 -0
  42. data/lib/tr8n_core/ext/fixnum.rb +39 -0
  43. data/lib/tr8n_core/ext/hash.rb +126 -0
  44. data/lib/tr8n_core/ext/string.rb +44 -0
  45. data/lib/tr8n_core/ext/time.rb +71 -0
  46. data/lib/tr8n_core/generators/cache/base.rb +85 -0
  47. data/lib/tr8n_core/generators/cache/cdb.rb +27 -0
  48. data/lib/tr8n_core/generators/cache/file.rb +69 -0
  49. data/lib/tr8n_core/modules/logger.rb +43 -0
  50. data/lib/tr8n_core/version.rb +27 -0
  51. data/lib/tr8n_core.rb +68 -0
  52. data/spec/application_spec.rb +228 -0
  53. data/spec/base_spec.rb +19 -0
  54. data/spec/config_spec.rb +16 -0
  55. data/spec/decorator_spec.rb +10 -0
  56. data/spec/decorators/base_spec.rb +14 -0
  57. data/spec/decorators/default_spec.rb +12 -0
  58. data/spec/decorators/html_spec.rb +50 -0
  59. data/spec/fixtures/application.json +112 -0
  60. data/spec/fixtures/languages/en-US.json +1424 -0
  61. data/spec/fixtures/languages/es.json +291 -0
  62. data/spec/fixtures/languages/ru.json +550 -0
  63. data/spec/fixtures/translations/ru/basic.json +56 -0
  64. data/spec/fixtures/translations/ru/counters.json +43 -0
  65. data/spec/fixtures/translations/ru/genders.json +171 -0
  66. data/spec/fixtures/translations/ru/last_names.txt +200 -0
  67. data/spec/fixtures/translations/ru/names.json +1 -0
  68. data/spec/fixtures/translations/ru/names.txt +458 -0
  69. data/spec/helper.rb +84 -0
  70. data/spec/language_case_rule_spec.rb +57 -0
  71. data/spec/language_case_spec.rb +58 -0
  72. data/spec/language_context_rule_spec.rb +73 -0
  73. data/spec/language_context_spec.rb +331 -0
  74. data/spec/language_spec.rb +16 -0
  75. data/spec/rules_engine/evaluator_spec.rb +148 -0
  76. data/spec/rules_engine/parser_spec.rb +29 -0
  77. data/spec/tokens/data_spec.rb +160 -0
  78. data/spec/tokens/data_tokenizer_spec.rb +29 -0
  79. data/spec/tokens/decoration_tokenizer_spec.rb +81 -0
  80. data/spec/tokens/hidden_spec.rb +24 -0
  81. data/spec/tokens/method_spec.rb +84 -0
  82. data/spec/tokens/transform_spec.rb +50 -0
  83. data/spec/translation_key_spec.rb +96 -0
  84. data/spec/translation_spec.rb +24 -0
  85. data/spec/utils_spec.rb +64 -0
  86. metadata +176 -0
metadata ADDED
@@ -0,0 +1,176 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tr8n_core
3
+ version: !ruby/object:Gem::Version
4
+ version: 4.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Michael Berkovich
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-03-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: faraday
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: Tr8n core classes that can be used by any Ruby framework
28
+ email:
29
+ - michael@tr8nhub.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - lib/tr8n/application.rb
35
+ - lib/tr8n/base.rb
36
+ - lib/tr8n/cache.rb
37
+ - lib/tr8n/cache_adapters/cdb.rb
38
+ - lib/tr8n/cache_adapters/file.rb
39
+ - lib/tr8n/cache_adapters/memcache.rb
40
+ - lib/tr8n/cache_adapters/redis.rb
41
+ - lib/tr8n/component.rb
42
+ - lib/tr8n/config.rb
43
+ - lib/tr8n/decorators/base.rb
44
+ - lib/tr8n/decorators/default.rb
45
+ - lib/tr8n/decorators/html.rb
46
+ - lib/tr8n/exception.rb
47
+ - lib/tr8n/language.rb
48
+ - lib/tr8n/language_case.rb
49
+ - lib/tr8n/language_case_rule.rb
50
+ - lib/tr8n/language_context.rb
51
+ - lib/tr8n/language_context_rule.rb
52
+ - lib/tr8n/logger.rb
53
+ - lib/tr8n/rules_engine/evaluator.rb
54
+ - lib/tr8n/rules_engine/parser.rb
55
+ - lib/tr8n/source.rb
56
+ - lib/tr8n/tokens/data.rb
57
+ - lib/tr8n/tokens/data_tokenizer.rb
58
+ - lib/tr8n/tokens/decoration_tokenizer.rb
59
+ - lib/tr8n/tokens/hidden.rb
60
+ - lib/tr8n/tokens/method.rb
61
+ - lib/tr8n/tokens/transform.rb
62
+ - lib/tr8n/translation.rb
63
+ - lib/tr8n/translation_key.rb
64
+ - lib/tr8n/translator.rb
65
+ - lib/tr8n/utils.rb
66
+ - lib/tr8n_core/ext/array.rb
67
+ - lib/tr8n_core/ext/date.rb
68
+ - lib/tr8n_core/ext/fixnum.rb
69
+ - lib/tr8n_core/ext/hash.rb
70
+ - lib/tr8n_core/ext/string.rb
71
+ - lib/tr8n_core/ext/time.rb
72
+ - lib/tr8n_core/generators/cache/base.rb
73
+ - lib/tr8n_core/generators/cache/cdb.rb
74
+ - lib/tr8n_core/generators/cache/file.rb
75
+ - lib/tr8n_core/modules/logger.rb
76
+ - lib/tr8n_core/version.rb
77
+ - lib/tr8n_core.rb
78
+ - config/config.yml
79
+ - config/tokens/data.yml
80
+ - config/tokens/decorations.yml
81
+ - LICENSE
82
+ - Rakefile
83
+ - README.md
84
+ - spec/application_spec.rb
85
+ - spec/base_spec.rb
86
+ - spec/config_spec.rb
87
+ - spec/decorator_spec.rb
88
+ - spec/decorators/base_spec.rb
89
+ - spec/decorators/default_spec.rb
90
+ - spec/decorators/html_spec.rb
91
+ - spec/fixtures/application.json
92
+ - spec/fixtures/languages/en-US.json
93
+ - spec/fixtures/languages/es.json
94
+ - spec/fixtures/languages/ru.json
95
+ - spec/fixtures/translations/ru/basic.json
96
+ - spec/fixtures/translations/ru/counters.json
97
+ - spec/fixtures/translations/ru/genders.json
98
+ - spec/fixtures/translations/ru/last_names.txt
99
+ - spec/fixtures/translations/ru/names.json
100
+ - spec/fixtures/translations/ru/names.txt
101
+ - spec/helper.rb
102
+ - spec/language_case_rule_spec.rb
103
+ - spec/language_case_spec.rb
104
+ - spec/language_context_rule_spec.rb
105
+ - spec/language_context_spec.rb
106
+ - spec/language_spec.rb
107
+ - spec/rules_engine/evaluator_spec.rb
108
+ - spec/rules_engine/parser_spec.rb
109
+ - spec/tokens/data_spec.rb
110
+ - spec/tokens/data_tokenizer_spec.rb
111
+ - spec/tokens/decoration_tokenizer_spec.rb
112
+ - spec/tokens/hidden_spec.rb
113
+ - spec/tokens/method_spec.rb
114
+ - spec/tokens/transform_spec.rb
115
+ - spec/translation_key_spec.rb
116
+ - spec/translation_spec.rb
117
+ - spec/utils_spec.rb
118
+ homepage: https://tr8nhub.com
119
+ licenses:
120
+ - MIT-LICENSE
121
+ metadata: {}
122
+ post_install_message:
123
+ rdoc_options: []
124
+ require_paths:
125
+ - lib
126
+ required_ruby_version: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - '>='
129
+ - !ruby/object:Gem::Version
130
+ version: '0'
131
+ required_rubygems_version: !ruby/object:Gem::Requirement
132
+ requirements:
133
+ - - '>='
134
+ - !ruby/object:Gem::Version
135
+ version: '0'
136
+ requirements: []
137
+ rubyforge_project:
138
+ rubygems_version: 2.0.3
139
+ signing_key:
140
+ specification_version: 4
141
+ summary: Tr8n Core Classes
142
+ test_files:
143
+ - spec/application_spec.rb
144
+ - spec/base_spec.rb
145
+ - spec/config_spec.rb
146
+ - spec/decorator_spec.rb
147
+ - spec/decorators/base_spec.rb
148
+ - spec/decorators/default_spec.rb
149
+ - spec/decorators/html_spec.rb
150
+ - spec/fixtures/application.json
151
+ - spec/fixtures/languages/en-US.json
152
+ - spec/fixtures/languages/es.json
153
+ - spec/fixtures/languages/ru.json
154
+ - spec/fixtures/translations/ru/basic.json
155
+ - spec/fixtures/translations/ru/counters.json
156
+ - spec/fixtures/translations/ru/genders.json
157
+ - spec/fixtures/translations/ru/last_names.txt
158
+ - spec/fixtures/translations/ru/names.json
159
+ - spec/fixtures/translations/ru/names.txt
160
+ - spec/helper.rb
161
+ - spec/language_case_rule_spec.rb
162
+ - spec/language_case_spec.rb
163
+ - spec/language_context_rule_spec.rb
164
+ - spec/language_context_spec.rb
165
+ - spec/language_spec.rb
166
+ - spec/rules_engine/evaluator_spec.rb
167
+ - spec/rules_engine/parser_spec.rb
168
+ - spec/tokens/data_spec.rb
169
+ - spec/tokens/data_tokenizer_spec.rb
170
+ - spec/tokens/decoration_tokenizer_spec.rb
171
+ - spec/tokens/hidden_spec.rb
172
+ - spec/tokens/method_spec.rb
173
+ - spec/tokens/transform_spec.rb
174
+ - spec/translation_key_spec.rb
175
+ - spec/translation_spec.rb
176
+ - spec/utils_spec.rb