carbonmu 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +3 -0
  3. data/.rspec +2 -0
  4. data/.ruby-gemset +1 -0
  5. data/.ruby-version +1 -0
  6. data/.travis.yml +14 -0
  7. data/Gemfile +3 -0
  8. data/Gemfile.lock +161 -0
  9. data/Guardfile +50 -0
  10. data/LICENSE.txt +21 -0
  11. data/README.md +66 -0
  12. data/Rakefile +10 -0
  13. data/carbonmu.gemspec +64 -0
  14. data/config/i18n-tasks.yml +89 -0
  15. data/config/locales/en.yml +6 -0
  16. data/config/locales/nl.yml +6 -0
  17. data/console +9 -0
  18. data/doc/architecture.png +0 -0
  19. data/lib/carbonmu.rb +42 -0
  20. data/lib/commands/locale_command.rb +12 -0
  21. data/lib/commands/ping_command.rb +9 -0
  22. data/lib/commands/reboot_command.rb +9 -0
  23. data/lib/commands/say_command.rb +10 -0
  24. data/lib/commands/unknown_command.rb +7 -0
  25. data/lib/core/command.rb +26 -0
  26. data/lib/core/command_context.rb +12 -0
  27. data/lib/core/configuration.rb +22 -0
  28. data/lib/core/connection.rb +19 -0
  29. data/lib/core/internationalization.rb +16 -0
  30. data/lib/core/parser.rb +29 -0
  31. data/lib/core/server.rb +118 -0
  32. data/lib/core/server_supervision_group.rb +5 -0
  33. data/lib/core_ext/match_data.rb +7 -0
  34. data/lib/core_ext/string.rb +5 -0
  35. data/lib/edge_router/edge_connection.rb +39 -0
  36. data/lib/edge_router/edge_router.rb +104 -0
  37. data/lib/edge_router/edge_router_supervision_group.rb +5 -0
  38. data/lib/edge_router/telnet_connection.rb +35 -0
  39. data/lib/edge_router/telnet_receptor.rb +30 -0
  40. data/lib/errors.rb +4 -0
  41. data/lib/game_objects/container.rb +10 -0
  42. data/lib/game_objects/exit.rb +8 -0
  43. data/lib/game_objects/game_object.rb +13 -0
  44. data/lib/game_objects/movable.rb +12 -0
  45. data/lib/game_objects/player.rb +17 -0
  46. data/lib/game_objects/room.rb +16 -0
  47. data/lib/game_objects/thing.rb +7 -0
  48. data/lib/interactions/notify.rb +11 -0
  49. data/lib/interactions/reboot.rb +8 -0
  50. data/lib/ipc/carbon_ipc_socket.rb +21 -0
  51. data/lib/ipc/ipc_message.rb +54 -0
  52. data/lib/ipc/read_socket.rb +18 -0
  53. data/lib/ipc/write_socket.rb +12 -0
  54. data/lib/version.rb +7 -0
  55. data/mongoid.yml +12 -0
  56. data/spec/carbonmu_spec.rb +14 -0
  57. data/spec/i18n_spec.rb +18 -0
  58. data/spec/lib/commands/say_command_spec.rb +11 -0
  59. data/spec/lib/core/command_context_spec.rb +16 -0
  60. data/spec/lib/core/command_spec.rb +37 -0
  61. data/spec/lib/core/configuration_spec.rb +37 -0
  62. data/spec/lib/core/connection_spec.rb +46 -0
  63. data/spec/lib/core/internationalization_spec.rb +24 -0
  64. data/spec/lib/core/parser_spec.rb +30 -0
  65. data/spec/lib/core/server_spec.rb +35 -0
  66. data/spec/lib/edge_router/edge_connection_spec.rb +9 -0
  67. data/spec/lib/game_objects/container_spec.rb +9 -0
  68. data/spec/lib/game_objects/exit_spec.rb +7 -0
  69. data/spec/lib/game_objects/game_object_spec.rb +12 -0
  70. data/spec/lib/game_objects/movable_spec.rb +9 -0
  71. data/spec/lib/game_objects/player_spec.rb +24 -0
  72. data/spec/lib/game_objects/room_spec.rb +20 -0
  73. data/spec/lib/game_objects/thing_spec.rb +7 -0
  74. data/spec/lib/interactions/notify_spec.rb +26 -0
  75. data/spec/lib/interactions/reboot_spec.rb +9 -0
  76. data/spec/lib/ipc/carbon_ipc_socket_spec.rb +12 -0
  77. data/spec/lib/ipc/ipc_message_spec.rb +39 -0
  78. data/spec/lib/ipc/read_socket_spec.bak +51 -0
  79. data/spec/lib/ipc/write_socket_spec.bak +25 -0
  80. data/spec/spec_helper.rb +118 -0
  81. data/spec/support/helpers.rb +15 -0
  82. data/spec/support/matchers/be_boolean.rb +5 -0
  83. data/spec/support/shared_examples/carbon_ipc_socket.rb +3 -0
  84. data/spec/support/shared_examples/container.rb +3 -0
  85. data/spec/support/shared_examples/game_object.rb +6 -0
  86. data/spec/support/shared_examples/movable.rb +4 -0
  87. data/start +5 -0
  88. data/start-server-only +8 -0
  89. metadata +416 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 53974bdbf1c1b7b9098bd891531def0b0a163fe1
4
+ data.tar.gz: 0ba17a6b68dc0090370ee7be96d6125ea4ceac12
5
+ SHA512:
6
+ metadata.gz: 7e8de6c21cf3e0e225bcfbd2f004b3ada12b6caa7ee598e62860d4b659e7f09bebd7777cc3fc0cda2748e7cc6cc791b3b2db1edfa8aa7b2e87f61c1b1754030d
7
+ data.tar.gz: 28f1428f645166759d57d55a9efee5777c6526e5fd25fd41372114d28418c603aeada747e6c8d00b79d0e6439382cdb7cd757d3f5e6a42902018414c0c47c88d
@@ -0,0 +1,3 @@
1
+ .yardoc
2
+ .*.swp
3
+ coverage
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
@@ -0,0 +1 @@
1
+ carbonmu
@@ -0,0 +1 @@
1
+ 2.1.5
@@ -0,0 +1,14 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ - 2.1.5
5
+ - 2.2.1
6
+ - rbx-2
7
+ - jruby-19mode
8
+ services:
9
+ - mongodb
10
+ addons:
11
+ code_climate:
12
+ repo_token: e3e4fc5da17ef3e332a5f62ce5a12d727ad472f367e41278df9d951b912cc748
13
+ before_install:
14
+ - sudo apt-get install -qq libzmq3-dev
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org/"
2
+
3
+ gemspec
@@ -0,0 +1,161 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ carbonmu (0.0.1)
5
+ celluloid-io (~> 0.16.1)
6
+ celluloid-zmq (~> 0.16.0)
7
+ colorize (~> 0.7.3)
8
+ i18n (~> 0.7.0)
9
+ mongoid (~> 4.0.2)
10
+ multi_json (~> 1.9.2)
11
+ require_all (~> 1.3.2)
12
+
13
+ GEM
14
+ remote: https://rubygems.org/
15
+ specs:
16
+ activemodel (4.2.0)
17
+ activesupport (= 4.2.0)
18
+ builder (~> 3.1)
19
+ activesupport (4.2.0)
20
+ i18n (~> 0.7)
21
+ json (~> 1.7, >= 1.7.7)
22
+ minitest (~> 5.1)
23
+ thread_safe (~> 0.3, >= 0.3.4)
24
+ tzinfo (~> 1.1)
25
+ awesome_print (1.6.1)
26
+ bson (2.3.0)
27
+ builder (3.2.2)
28
+ celluloid (0.16.0)
29
+ timers (~> 4.0.0)
30
+ celluloid-io (0.16.2)
31
+ celluloid (>= 0.16.0)
32
+ nio4r (>= 1.1.0)
33
+ celluloid-zmq (0.16.0)
34
+ celluloid (>= 0.15.0)
35
+ ffi
36
+ ffi-rzmq
37
+ coderay (1.1.0)
38
+ colorize (0.7.5)
39
+ connection_pool (2.1.1)
40
+ database_cleaner (1.3.0)
41
+ diff-lcs (1.2.5)
42
+ easy_translate (0.5.0)
43
+ json
44
+ thread
45
+ thread_safe
46
+ erubis (2.7.0)
47
+ fakefs (0.6.7)
48
+ ffi (1.9.6)
49
+ ffi-rzmq (2.0.4)
50
+ ffi-rzmq-core (>= 1.0.1)
51
+ ffi-rzmq-core (1.0.3)
52
+ ffi (~> 1.9)
53
+ formatador (0.2.5)
54
+ guard (2.12.4)
55
+ formatador (>= 0.2.4)
56
+ listen (~> 2.7)
57
+ lumberjack (~> 1.0)
58
+ nenv (~> 0.1)
59
+ notiffany (~> 0.0)
60
+ pry (>= 0.9.12)
61
+ shellany (~> 0.0)
62
+ thor (>= 0.18.1)
63
+ guard-compat (1.2.1)
64
+ guard-rspec (4.5.0)
65
+ guard (~> 2.1)
66
+ guard-compat (~> 1.1)
67
+ rspec (>= 2.99.0, < 4.0)
68
+ highline (1.7.1)
69
+ hitimes (1.2.2)
70
+ i18n (0.7.0)
71
+ i18n-tasks (0.7.12)
72
+ activesupport
73
+ easy_translate (>= 0.5.0)
74
+ erubis
75
+ highline
76
+ i18n
77
+ slop (~> 3.5)
78
+ term-ansicolor
79
+ terminal-table
80
+ json (1.8.2)
81
+ listen (2.8.5)
82
+ celluloid (>= 0.15.2)
83
+ rb-fsevent (>= 0.9.3)
84
+ rb-inotify (>= 0.9)
85
+ lumberjack (1.0.9)
86
+ method_source (0.8.2)
87
+ minitest (5.5.1)
88
+ mongoid (4.0.2)
89
+ activemodel (~> 4.0)
90
+ moped (~> 2.0.0)
91
+ origin (~> 2.1)
92
+ tzinfo (>= 0.3.37)
93
+ mongoid-rspec (2.1.0)
94
+ mongoid (~> 4.0.0)
95
+ rake
96
+ rspec (~> 3.1)
97
+ moped (2.0.4)
98
+ bson (~> 2.2)
99
+ connection_pool (~> 2.0)
100
+ optionable (~> 0.2.0)
101
+ multi_json (1.9.3)
102
+ nenv (0.2.0)
103
+ nio4r (1.1.0)
104
+ notiffany (0.0.6)
105
+ nenv (~> 0.1)
106
+ shellany (~> 0.0)
107
+ optionable (0.2.0)
108
+ origin (2.1.1)
109
+ pry (0.10.1)
110
+ coderay (~> 1.1.0)
111
+ method_source (~> 0.8.1)
112
+ slop (~> 3.4)
113
+ rake (10.4.2)
114
+ rb-fsevent (0.9.4)
115
+ rb-inotify (0.9.5)
116
+ ffi (>= 0.5.0)
117
+ require_all (1.3.2)
118
+ rspec (3.2.0)
119
+ rspec-core (~> 3.2.0)
120
+ rspec-expectations (~> 3.2.0)
121
+ rspec-mocks (~> 3.2.0)
122
+ rspec-core (3.2.1)
123
+ rspec-support (~> 3.2.0)
124
+ rspec-expectations (3.2.0)
125
+ diff-lcs (>= 1.2.0, < 2.0)
126
+ rspec-support (~> 3.2.0)
127
+ rspec-mocks (3.2.1)
128
+ diff-lcs (>= 1.2.0, < 2.0)
129
+ rspec-support (~> 3.2.0)
130
+ rspec-support (3.2.2)
131
+ shellany (0.0.1)
132
+ slop (3.6.0)
133
+ term-ansicolor (1.3.0)
134
+ tins (~> 1.0)
135
+ terminal-table (1.4.5)
136
+ thor (0.19.1)
137
+ thread (0.1.5)
138
+ thread_safe (0.3.4)
139
+ timecop (0.7.3)
140
+ timers (4.0.1)
141
+ hitimes
142
+ tins (1.3.5)
143
+ tzinfo (1.2.2)
144
+ thread_safe (~> 0.1)
145
+
146
+ PLATFORMS
147
+ ruby
148
+
149
+ DEPENDENCIES
150
+ awesome_print
151
+ carbonmu!
152
+ database_cleaner (~> 1.3.0)
153
+ fakefs
154
+ guard (~> 2.12.4)
155
+ guard-rspec (~> 4.5.0)
156
+ i18n-tasks (~> 0.7.12)
157
+ mongoid-rspec
158
+ pry
159
+ rake
160
+ rspec (~> 3.2.0)
161
+ timecop
@@ -0,0 +1,50 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ ## Uncomment and set this to only include directories you want to watch
5
+ # directories %w(app lib config test spec features)
6
+
7
+ ## Uncomment to clear the screen before every task
8
+ clearing :on
9
+
10
+ ## Guard internally checks for changes in the Guardfile and exits.
11
+ ## If you want Guard to automatically start up again, run guard in a
12
+ ## shell loop, e.g.:
13
+ ##
14
+ ## $ while bundle exec guard; do echo "Restarting Guard..."; done
15
+ ##
16
+ ## Note: if you are using the `directories` clause above and you are not
17
+ ## watching the project directory ('.'), then you will want to move
18
+ ## the Guardfile to a watched dir and symlink it back, e.g.
19
+ #
20
+ # $ mkdir config
21
+ # $ mv Guardfile config/
22
+ # $ ln -s config/Guardfile .
23
+ #
24
+ # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
25
+
26
+ # Note: The cmd option is now required due to the increasing number of ways
27
+ # rspec may be run, below are examples of the most common uses.
28
+ # * bundler: 'bundle exec rspec'
29
+ # * bundler binstubs: 'bin/rspec'
30
+ # * spring: 'bin/rspec' (This will use spring if running and you have
31
+ # installed the spring binstubs per the docs)
32
+ # * zeus: 'zeus rspec' (requires the server to be started separately)
33
+ # * 'just' rspec: 'rspec'
34
+
35
+ guard :rspec, cmd: "bundle exec rspec" do
36
+ require "guard/rspec/dsl"
37
+ dsl = Guard::RSpec::Dsl.new(self)
38
+
39
+ # Feel free to open issues for suggestions and improvements
40
+
41
+ # RSpec files
42
+ rspec = dsl.rspec
43
+ watch(rspec.spec_helper) { rspec.spec_dir }
44
+ watch(rspec.spec_support) { rspec.spec_dir }
45
+ watch(rspec.spec_files)
46
+
47
+ # Ruby files
48
+ ruby = dsl.ruby
49
+ dsl.watch_spec_files_for(ruby.lib_files)
50
+ end
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Tim Krajcar <allegro@conmolto.org>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,66 @@
1
+ [![Join the chat at https://gitter.im/tkrajcar/carbonmu](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/tkrajcar/carbonmu?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
2
+ [![Stories in Ready](https://badge.waffle.io/tkrajcar/carbonmu.png?label=ready&title=Ready)](https://waffle.io/tkrajcar/carbonmu)
3
+ [![Build Status](https://travis-ci.org/tkrajcar/carbonmu.png?branch=master)](https://travis-ci.org/tkrajcar/carbonmu)
4
+ [![Code Climate](https://codeclimate.com/github/tkrajcar/carbonmu.png)](https://codeclimate.com/github/tkrajcar/carbonmu)
5
+
6
+ # CarbonMU
7
+ CarbonMU is a general-purpose, extendable MUD/MUSH server framework written in Ruby. It's designed to scale to thousands of players, handle a wide variety of game types, from classic hack-n-slash MUDs to innovative text-based social communities. **CarbonMU is not ready for public use by non-developers, but we welcome user contributions to help move the project along**.
8
+
9
+ The remainder of this documentation is currently intended more as design documentation than how-tos.
10
+
11
+ ## Where to talk about CarbonMU
12
+
13
+ * In the near future there will be an official CarbonMU support site running... CarbonMU. In the meantime, you can find me on M\*U\*S\*H (mush.pennmush.org 4201) as Rince.
14
+ * Use [Gitter](https://gitter.im/tkrajcar/carbonmu), a nifty chat system that integrates with Github.
15
+
16
+ ## The road to 1.0
17
+
18
+ See [this wiki page](https://github.com/tkrajcar/carbonmu/wiki/The-road-to-1.0) for the latest updates on what's on the todo list. You are more than welcome to get involved! Feel free to open issues with questions, join discussions, or ask if you need help finding a task suitable for your interest and skill level.
19
+
20
+ ## Architecture
21
+
22
+ CarbonMU is powered by [Celluloid](https://celluloid.io/), an actor-based concurrency/multithreading framework, plus [ZeroMQ](http://zeromq.org/) for inter-process communication, and uses MongoDB (via [Mongoid](http://mongoid.org/)) to store all of its data. The framework is designed to support a variety of connections, including basic TCP telnet, SSL telnet, and JSON over HTTP, API-style.
23
+
24
+ It's also intended to use a highly plugin-based model. A typical CarbonMU game will probably consist of the carbonmu core gem (what you see here), some number of community-supported third-party gems to provide things like a bboard system and other common utilities, and some game-specific custom code. It will not include a scripting engine or "softcode"-type functionality.
25
+
26
+ Internally, CarbonMU looks like this:
27
+
28
+ ![architecture diagram](https://raw.githubusercontent.com/tkrajcar/carbonmu/master/doc/architecture.png)
29
+
30
+ The `EdgeRouter` and `Server` are separate actors. The `Server` can be therefore be restarted to load new game code without dropping TCP connections.
31
+
32
+ ## Game objects
33
+
34
+ There are four built-in descendants of `GameObject` in core (modules may choose to add their own).
35
+ They are:
36
+
37
+ * `Room`, which mixes in `Container` so it can have contents
38
+ * `Thing`, something tangible that is in one and only one room (mixes in `Movable`), and also can have contents (is a `Container`)
39
+ * `Player`, similar to `Thing` except can be logged into, and will support more interactions (i.e. you can send in-game mail to a `Player`, but not a `Thing`). Includes `Movable` and `Container`.
40
+ * `Exit`, a connection between two `Room`s.
41
+
42
+ All of these are stored in MongoDB in the `game_objects` collection.
43
+
44
+ ## Other data
45
+
46
+ Of course, MU*s need a lot more data than just things that can be interacted with. There'll be things like bboard messages, mail, and thousands of other things games will want to add for their custom needs. Plugins are welcome to declare their own classes that inherit `Mongoid::Document`, and can even reference the `GameObject` descendants. There's no need to create 'data objects' and store them there.
47
+
48
+ ## Commands
49
+
50
+ Defining a new command is done by subclassing Command, adding one or more `syntax` calls using regular expressions with named captures for parameters, and providing an `execute` model that receives a `@params` hash with its named captures and a [CommandContext](https://github.com/tkrajcar/carbonmu/blob/master/lib/core/command_context.rb) instance in `@context`. See [lib/commands](https://github.com/tkrajcar/carbonmu/tree/master/lib/commands) for examples. This will continue to be fleshed out.
51
+
52
+ ## Events
53
+
54
+ We will use a pubsub model (not yet implemented) to allow for both core functionality and people's gems to provide behavior when game events occur, as well as register their own events too.
55
+
56
+ ## Building external plugins/modules/gems
57
+
58
+ This needs to be documented in detail once an example is done.
59
+
60
+ ## Internationalization
61
+
62
+ CarbonMU will have full i18n support on a per-player basis, allowing each player to see game messages in their own locales (of course, chat messages and so on will not be auto-translated).
63
+
64
+ ## Supported Rubies
65
+
66
+ CarbonMU is supported on Ruby 2.0.x or newer, JRuby (latest release), and Rubinius (latest release). Using JRuby or Rubinius will allow your game to be multi-threaded.
@@ -0,0 +1,10 @@
1
+ require 'rspec/core/rake_task'
2
+
3
+ RSpec::Core::RakeTask.new(:spec)
4
+
5
+ task :default => :spec
6
+
7
+ desc "Run I18n specs (check for missing & unused keys)."
8
+ RSpec::Core::RakeTask.new('spec:i18n') do |task|
9
+ task.rspec_opts = "--tag i18n"
10
+ end
@@ -0,0 +1,64 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push('lib')
3
+ require "version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "carbonmu"
7
+ s.version = CarbonMU::VERSION.dup
8
+ s.required_ruby_version = ">= 2.0.0"
9
+ s.date = Time.now.strftime('%Y-%m-%d')
10
+ s.summary = "CarbonMU is a general-purpose, extendable MUD/MUSH server written in Ruby."
11
+ s.email = "allegro@conmolto.org"
12
+ s.homepage = "http://github.com/tkrajcar/carbonmu"
13
+ s.authors = ['Tim Krajcar']
14
+ s.licenses = ['MIT']
15
+
16
+ s.description = <<-EOF
17
+ CarbonMU is a general-purpose, extendable MUD/MUSH server written in Ruby. CarbonMU is still
18
+ under active development and not yet ready for general use.
19
+ EOF
20
+
21
+ s.add_dependency "celluloid-io", "~> 0.16.1"
22
+ s.add_dependency "require_all", "~> 1.3.2"
23
+ s.add_dependency "multi_json", "~> 1.9.2"
24
+ s.add_dependency "celluloid-zmq", "~> 0.16.0"
25
+ s.add_dependency "colorize", "~> 0.7.3"
26
+ s.add_dependency "mongoid", "~> 4.0.2"
27
+ s.add_dependency "i18n", "~> 0.7.0"
28
+
29
+ s.add_development_dependency "awesome_print"
30
+ s.add_development_dependency "pry"
31
+ s.add_development_dependency "rake"
32
+ s.add_development_dependency "guard", "~> 2.12.4"
33
+ s.add_development_dependency "guard-rspec", "~> 4.5.0"
34
+ s.add_development_dependency "mongoid-rspec"
35
+ s.add_development_dependency "rspec", "~> 3.2.0"
36
+ s.add_development_dependency "timecop"
37
+ s.add_development_dependency "database_cleaner", "~> 1.3.0"
38
+ s.add_development_dependency "i18n-tasks", "~> 0.7.12"
39
+ s.add_development_dependency "fakefs"
40
+
41
+ dependencies = [
42
+ # Examples:
43
+ # [:runtime, "rack", "~> 1.1"],
44
+ # [:development, "rspec", "~> 2.1"],
45
+ ]
46
+
47
+ s.files = `git ls-files`.split
48
+ s.test_files = Dir['spec/**/*']
49
+ #s.executables = Dir['bin/*'].map { |f| File.basename(f) }
50
+ s.require_paths = ["lib"]
51
+
52
+ ## Make sure you can build the s.add_dependency on older versions of RubyGems too:
53
+ s.rubygems_version = "2.2.2"
54
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
55
+ s.specification_version = 3 if s.respond_to? :specification_version
56
+
57
+ dependencies.each do |type, name, version|
58
+ if s.respond_to?("add_#{type}_dependency")
59
+ s.send("add_#{type}_dependency", name, version)
60
+ else
61
+ s.add_dependency(name, version)
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,89 @@
1
+ # i18n-tasks finds and manages missing and unused translations https://github.com/glebm/i18n-tasks
2
+
3
+ base_locale: en
4
+ ## i18n-tasks detects locales automatically from the existing locale files
5
+ ## uncomment to set locales explicitly
6
+ # locales: [en, es, fr]
7
+
8
+ ## i18n-tasks report locale, default: en, available: en, ru
9
+ # internal_locale: ru
10
+
11
+ # Read and write locale data
12
+ data:
13
+ ## by default, translation data are read from the file system, or you can provide a custom data adapter
14
+ # adapter: I18n::Tasks::Data::FileSystem
15
+
16
+ # Locale files to read from
17
+ read:
18
+ - config/locales/%{locale}.yml
19
+ # - config/locales/*.%{locale}.yml
20
+ # - config/locales/**/*.%{locale}.yml
21
+
22
+ # key => file routes, matched top to bottom
23
+ write:
24
+ ## E.g., write devise and simple form keys to their respective files
25
+ # - ['{devise, simple_form}.*', 'config/locales/\1.%{locale}.yml']
26
+ # Catch-all
27
+ - config/locales/%{locale}.yml
28
+ # `i18n-tasks normalize -p` will force move the keys according to these rules
29
+
30
+ # YAML / JSON serializer options, passed to load / dump / parse / serialize
31
+ yaml:
32
+ write:
33
+ # do not wrap lines at 80 characters
34
+ line_width: -1
35
+ json:
36
+ write:
37
+ # pretty print JSON
38
+ indent: ' '
39
+ space: ' '
40
+ object_nl: "\n"
41
+ array_nl: "\n"
42
+
43
+ # Find translate calls
44
+ search:
45
+ ## Default scanner finds t() and I18n.t() calls
46
+ # scanner: I18n::Tasks::Scanners::PatternWithScopeScanner
47
+
48
+ ## Paths to search in, passed to File.find
49
+ paths:
50
+ - app/
51
+
52
+ ## Root for resolving relative keys (default)
53
+ # relative_roots:
54
+ # - app/views
55
+
56
+ ## File.fnmatch patterns to exclude from search (default)
57
+ # exclude: ["*.jpg", "*.png", "*.gif", "*.svg", "*.ico", "*.eot", "*.ttf", "*.woff", "*.pdf"]
58
+
59
+ ## Or, File.fnmatch patterns to include
60
+ # include: ["*.rb", "*.html.slim"]
61
+
62
+ ## Google Translate
63
+ # translation:
64
+ # # Get an API key and set billing info at https://code.google.com/apis/console to use Google Translate
65
+ # api_key: "AbC-dEf5"
66
+
67
+ ## Consider these keys not missing
68
+ # ignore_missing:
69
+ # - 'errors.messages.{accepted,blank,invalid,too_short,too_long}'
70
+ # - '{devise,simple_form}.*'
71
+
72
+ ## Consider these keys used
73
+ # ignore_unused:
74
+ # - 'activerecord.attributes.*'
75
+ # - '{devise,kaminari,will_paginate}.*'
76
+ # - 'simple_form.{yes,no}'
77
+ # - 'simple_form.{placeholders,hints,labels}.*'
78
+ # - 'simple_form.{error_notification,required}.:'
79
+
80
+ ## Exclude these keys from `i18n-tasks eq-base' report
81
+ # ignore_eq_base:
82
+ # all:
83
+ # - common.ok
84
+ # fr,es:
85
+ # - common.brand
86
+
87
+ ## Exclude these keys from all of the reports
88
+ # ignore:
89
+ # - kaminari.*