Name the gem "hamlit"

Hamlit is an abbreviation of "HAML ImplemenTation".
It also means "haml it", i.e. "write it with haml".
This commit is contained in:
Takashi Kokubun 2015-03-12 09:07:49 +09:00
parent 3d875d0472
commit dfad202149
16 changed files with 27 additions and 27 deletions

View File

@ -1,4 +1,4 @@
source 'https://rubygems.org'
# Specify your gem's dependencies in hamilton.gemspec
# Specify your gem's dependencies in hamlit.gemspec
gemspec

View File

@ -1,4 +1,4 @@
# Hamilton
# Hamlit
Yet another haml implementation

View File

@ -1,16 +1,16 @@
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'hamilton/version'
require 'hamlit/version'
Gem::Specification.new do |spec|
spec.name = "hamilton"
spec.version = Hamilton::VERSION
spec.name = "hamlit"
spec.version = Hamlit::VERSION
spec.authors = ["Takashi Kokubun"]
spec.email = ["takashikkbn@gmail.com"]
spec.summary = %q{Yet another haml implementation}
spec.description = %q{Yet another haml implementation}
spec.homepage = "https://github.com/k0kubun/hamilton"
spec.homepage = "https://github.com/k0kubun/hamlit"
spec.license = "MIT"
spec.files = `git ls-files -z`.split("\x0")

View File

@ -1,5 +0,0 @@
require 'hamilton/engine'
require 'hamilton/version'
module Hamilton
end

5
lib/hamlit.rb Normal file
View File

@ -0,0 +1,5 @@
require 'hamlit/engine'
require 'hamlit/version'
module Hamlit
end

View File

@ -1,7 +1,7 @@
require 'temple'
require 'hamilton/parser'
require 'hamlit/parser'
module Hamilton
module Hamlit
class Engine < Temple::Engine
use Parser
html :Fast

View File

@ -1,6 +1,6 @@
require 'temple'
module Hamilton
module Hamlit
class Parser < Temple::Parser
TAG_ID_CLASS_REGEXP = /[a-zA-Z0-9_-]+/
INTERNAL_STATEMENTS = %w[else elsif when].freeze

View File

@ -1,3 +1,3 @@
module Hamilton
module Hamlit
VERSION = "0.0.1"
end

View File

@ -1,4 +1,4 @@
describe Hamilton::Engine do
describe Hamlit::Engine do
describe 'doctype' do
it 'renders html5 doctype' do
assert_render(<<-HAML, <<-HTML)

View File

@ -1,4 +1,4 @@
describe Hamilton::Engine do
describe Hamlit::Engine do
describe 'script' do
it 'parses one-line script' do
assert_render(<<-HAML, <<-HTML)

View File

@ -1,4 +1,4 @@
describe Hamilton::Engine do
describe Hamlit::Engine do
describe 'silent script' do
it 'parses silent script' do
assert_render(<<-HAML, <<-HTML)

View File

@ -1,4 +1,4 @@
describe Hamilton::Engine do
describe Hamlit::Engine do
describe 'tag' do
it 'parses one-line tag' do
assert_render(<<-HAML, <<-HTML)

View File

@ -1,4 +1,4 @@
describe Hamilton::Parser do
describe Hamlit::Parser do
describe 'doctype' do
it 'parses html5 doctype' do
assert_parse(<<-HAML) do

View File

@ -1,4 +1,4 @@
describe Hamilton::Parser do
describe Hamlit::Parser do
describe 'silent script' do
it 'parses silent script' do
assert_parse(<<-HAML) do

View File

@ -1,4 +1,4 @@
describe Hamilton::Parser do
describe Hamlit::Parser do
describe 'tag' do
it 'parses one-line tag' do
assert_parse(<<-HAML) do

View File

@ -1,13 +1,13 @@
require 'hamilton'
require 'hamlit'
require 'unindent'
module HamiltonSpecHelper
module HamlitSpecHelper
def parse_string(str)
Hamilton::Parser.new.call(str)
Hamlit::Parser.new.call(str)
end
def render_string(str)
eval Hamilton::Engine.new.call(str)
eval Hamlit::Engine.new.call(str)
end
def assert_render(haml, html)
@ -26,7 +26,7 @@ module HamiltonSpecHelper
end
RSpec.configure do |config|
config.include HamiltonSpecHelper
config.include HamlitSpecHelper
config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true