Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

first commit

  • Loading branch information...
commit 483d94684c5d2857357621b020cb4bd0d9305645 0 parents
@txus authored
17 .gitignore
@@ -0,0 +1,17 @@
+*.gem
+*.rbc
+.bundle
+.config
+.yardoc
+Gemfile.lock
+InstalledFiles
+_yardoc
+coverage
+doc/
+lib/bundler/man
+pkg
+rdoc
+spec/reports
+test/tmp
+test/version_tmp
+tmp
4 Gemfile
@@ -0,0 +1,4 @@
+source 'https://rubygems.org'
+
+# Specify your gem's dependencies in mayl.gemspec
+gemspec
22 LICENSE
@@ -0,0 +1,22 @@
+Copyright (c) 2012 Josep M. Bach
+
+MIT License
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
99 README.md
@@ -0,0 +1,99 @@
+# mayl - a YAML console
+
+Mayl is an anagram of YAML, and also a console to create, edit and maintain
+YAML files in any kind of Ruby projects.
+
+## Warning: Not released yet
+
+This is not a released project yet. It's just a Readme specification to define
+the API and some features. You'll see a usable version soon! ;)
+
+## Installation
+
+Install mayl yourself:
+
+ $ gem install mayl
+
+## Usage
+
+Mayl expects your YAML files to be organized like this: one file per locale
+(`en.yml`, `es.yml`, `ca.yml`...) in a directory.
+
+When it starts, it needs to know where to find all these YAML files, and it
+looks by default under `./config/locales` but you can always run it like `mayl
+some/other/dir` to override this.
+
+ $ mayl
+ Detected locales: ca, en, es
+ >
+
+Now we'll set a new key by typing `set KEY` and typing in the translations:
+
+ > set activerecord.models.post
+ ca: Article
+ en: Post
+ es: Artículo
+
+ Set activerecord.models.post to Article (ca), Post (en) and Artículo (es)
+ >
+
+Changes get written to the file immediately. We can consult a key any time,
+and in case we see any error, correct it quickly with `edit LOCALE NEWVALUE`:
+
+ > get activerecord.models.post
+ ca: Article
+ en: Post
+ es: Artículo
+ > edit es Entrada
+
+ Set activerecord.models.post to Entrada (es)
+ >
+
+### Namespaces
+
+If you want to work for a while inside a namespace, let's say
+`activerecord.models`, you can do so by `cd`-ing into it, and even `ls` the
+existing keys:
+
+ > cd activerecord.models
+ activerecord.models > get post
+ ca: Article
+ en: Post
+ es: Entrada
+ activerecord.models > cd ..
+ activerecord > ls
+ models attributes
+ activerecord > cd ..
+ >
+
+Cool way to navigate your YAML files huh?
+
+### Other useful commands
+
+* `reload`: Reloads the file in case someone has changed it for some reason
+ (which ideally should not happen).
+* `exit`: Exits the console.
+
+## Development
+
+To run the tests:
+
+ $ rake
+
+To build the documentation under the `doc` directory:
+
+ $ rake doc
+
+## Contributing
+
+1. Fork it
+2. Create your feature branch (`git checkout -b my-new-feature`)
+3. Commit your changes (`git commit -am 'Added some feature'`)
+4. Push to the branch (`git push origin my-new-feature`)
+5. Create new Pull Request
+
+## Who's this
+
+This was made by [Josep M. Bach (Txus)](http://txustice.me) under the MIT
+license. I'm [@txustice](http://twitter.com/txustice) on twitter (where you
+should probably follow me!).
18 Rakefile
@@ -0,0 +1,18 @@
+#!/usr/bin/env rake
+require "bundler/gem_tasks"
+
+require 'yard'
+YARD::Config.load_plugin('yard-tomdoc')
+YARD::Rake::YardocTask.new do |t|
+ t.files = ['lib/**/*.rb']
+ t.options = %w(-r README.md)
+end
+
+require 'rake/testtask'
+Rake::TestTask.new do |t|
+ t.libs << "test"
+ t.test_files = FileList['./test/**/*_test.rb']
+end
+
+task :doc => :yard
+task :default => :test
3  bin/mayl
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+$: << 'lib'
+require 'mayl'
6 lib/mayl.rb
@@ -0,0 +1,6 @@
+require "mayl/version"
+
+# Public: Mayl is an anagram of YAML, and also a console to create, edit and
+# maintain YAML files in any kind of Ruby projects.
+module Mayl
+end
4 lib/mayl/version.rb
@@ -0,0 +1,4 @@
+module Mayl
+ # The version of the Mayl gem.
+ VERSION = "0.0.1"
+end
22 mayl.gemspec
@@ -0,0 +1,22 @@
+# -*- encoding: utf-8 -*-
+require File.expand_path('../lib/mayl/version', __FILE__)
+
+Gem::Specification.new do |gem|
+ gem.authors = ["Josep M. Bach"]
+ gem.email = ["josep.m.bach@gmail.com"]
+ gem.description = %q{TODO: Write a gem description}
+ gem.summary = %q{TODO: Write a gem summary}
+ gem.homepage = ""
+
+ gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
+ gem.files = `git ls-files`.split("\n")
+ gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ gem.name = "mayl"
+ gem.require_paths = ["lib"]
+ gem.version = Mayl::VERSION
+
+ gem.add_development_dependency 'yard'
+ gem.add_development_dependency 'yard-tomdoc'
+ gem.add_development_dependency 'redcarpet'
+ gem.add_development_dependency 'minitest'
+end
7 test/mayl_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+describe Mayl do
+ it 'rocks' do
+ true.must_equal true
+ end
+end
4 test/test_helper.rb
@@ -0,0 +1,4 @@
+gem 'minitest'
+require 'minitest/spec'
+require 'minitest/autorun'
+require 'mayl'
Please sign in to comment.
Something went wrong with that request. Please try again.