Skip to content

Commit

Permalink
Rename project name Asterisk to Astrolabe
Browse files Browse the repository at this point in the history
  • Loading branch information
yujinakayama committed Jul 4, 2014
1 parent e23daf3 commit 7fa22fa
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 36 deletions.
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
[![Gem Version](http://img.shields.io/gem/v/asterisk.svg)](http://badge.fury.io/rb/asterisk)
[![Dependency Status](http://img.shields.io/gemnasium/yujinakayama/asterisk.svg)](https://gemnasium.com/yujinakayama/asterisk)
[![Build Status](https://travis-ci.org/yujinakayama/asterisk.svg?branch=master)](https://travis-ci.org/yujinakayama/asterisk)
[![Coverage Status](http://img.shields.io/coveralls/yujinakayama/asterisk/master.svg)](https://coveralls.io/r/yujinakayama/asterisk)
[![Code Climate](http://img.shields.io/codeclimate/github/yujinakayama/asterisk.svg)](https://codeclimate.com/github/yujinakayama/asterisk)
[![Gem Version](http://img.shields.io/gem/v/astrolabe.svg)](http://badge.fury.io/rb/astrolabe)
[![Dependency Status](http://img.shields.io/gemnasium/yujinakayama/astrolabe.svg)](https://gemnasium.com/yujinakayama/astrolabe)
[![Build Status](https://travis-ci.org/yujinakayama/astrolabe.svg?branch=master)](https://travis-ci.org/yujinakayama/astrolabe)
[![Coverage Status](http://img.shields.io/coveralls/yujinakayama/astrolabe/master.svg)](https://coveralls.io/r/yujinakayama/astrolabe)
[![Code Climate](http://img.shields.io/codeclimate/github/yujinakayama/astrolabe.svg)](https://codeclimate.com/github/yujinakayama/astrolabe)

# Asterisk
# Astrolabe

**Asterisk** is an AST node library that provides an object-oriented way to handle AST by extending [Parser](https://github.com/whitequark/parser)'s node class.
**Astrolabe** is an AST node library that provides an object-oriented way to handle AST by extending [Parser](https://github.com/whitequark/parser)'s node class.

## Installation

Add this line to your `Gemfile`:

```ruby
gem 'asterisk'
gem 'astrolabe'
```

And then execute:
Expand All @@ -24,30 +24,30 @@ $ bundle install

## Usage

You can generate an AST that consists of `Asterisk::Node` by using `Asterisk::Builder` along with `Parser`:
You can generate an AST that consists of `Astrolabe::Node` by using `Astrolabe::Builder` along with `Parser`:

```ruby
require 'asterisk/builder'
require 'astrolabe/builder'
require 'parser/current'

buffer = Parser::Source::Buffer.new('(string)')
buffer.source = 'puts :foo'

builder = Asterisk::Builder.new
builder = Astrolabe::Builder.new
parser = Parser::CurrentRuby.new(builder)

root_node = parser.parse(buffer)
root_node.class # => Asterisk::Node
root_node.class # => Astrolabe::Node
```

`Asterisk::Node` is a subclass of [`Parser::AST::Node`](http://rubydoc.info/gems/parser/Parser/AST/Node).
`Astrolabe::Node` is a subclass of [`Parser::AST::Node`](http://rubydoc.info/gems/parser/Parser/AST/Node).

## APIs

See these references for all the public APIs:

* [`Asterisk::Node`](http://rubydoc.info/gems/asterisk/Asterisk/Node)
* [`Asterisk::Builder`](http://rubydoc.info/gems/asterisk/Asterisk/Builder)
* [`Astrolabe::Node`](http://rubydoc.info/gems/astrolabe/Astrolabe/Node)
* [`Astrolabe::Builder`](http://rubydoc.info/gems/astrolabe/Astrolabe/Builder)

### Node Type Predicate Methods

Expand Down
10 changes: 5 additions & 5 deletions asterisk.gemspec → astrolabe.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'asterisk/version'
require 'astrolabe/version'

Gem::Specification.new do |spec|
spec.name = 'asterisk'
spec.version = Asterisk::Version.to_s
spec.name = 'astrolabe'
spec.version = Astrolabe::Version.to_s
spec.authors = ['Yuji Nakayama']
spec.email = ['nkymyj@gmail.com']
spec.summary = 'Object-oriented AST for Parser'
spec.summary = 'Object-oriented AST library for Parser'
spec.description = spec.summary
spec.homepage = 'https://github.com/yujinakayama/asterisk'
spec.homepage = 'https://github.com/yujinakayama/astrolabe'
spec.license = 'MIT'

spec.files = `git ls-files -z`.split("\x0")
Expand Down
3 changes: 0 additions & 3 deletions lib/asterisk.rb

This file was deleted.

3 changes: 3 additions & 0 deletions lib/astrolabe.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# coding: utf-8

require 'astrolabe/builder'
12 changes: 6 additions & 6 deletions lib/asterisk/builder.rb → lib/astrolabe/builder.rb
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# coding: utf-8

require 'asterisk/node'
require 'astrolabe/node'
require 'parser'

module Asterisk
# `Asterisk::Builder` is an AST builder that is utilized to let `Parser` generate AST with
# {Asterisk::Node}.
module Astrolabe
# `Astrolabe::Builder` is an AST builder that is utilized to let `Parser` generate AST with
# {Astrolabe::Node}.
#
# @example
# require 'asterisk/builder'
# require 'astrolabe/builder'
# require 'parser/current'
#
# buffer = Parser::Source::Buffer.new('(string)')
# buffer.source = 'puts :foo'
#
# builder = Asterisk::Builder.new
# builder = Astrolabe::Builder.new
# parser = Parser::CurrentRuby.new(builder)
# root_node = parser.parse(buffer)
class Builder < Parser::Builders::Default
Expand Down
4 changes: 2 additions & 2 deletions lib/asterisk/node.rb → lib/astrolabe/node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

require 'parser'

module Asterisk
# `Asterisk::Node` is a subclass of `Parser::AST::Node`. It provides an access to parent node and
module Astrolabe
# `Astrolabe::Node` is a subclass of `Parser::AST::Node`. It provides an access to parent node and
# an object-oriented way to handle AST with the power of `Enumerable`.
#
# Though not described in the auto-generated API documentation, it has predicate methods for every
Expand Down
2 changes: 1 addition & 1 deletion lib/asterisk/version.rb → lib/astrolabe/version.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding: utf-8

module Asterisk
module Astrolabe
# @api private
# http://semver.org/
module Version
Expand Down
4 changes: 2 additions & 2 deletions spec/asterisk/node_spec.rb → spec/astrolabe/node_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# coding: utf-8

require 'asterisk/node'
require 'astrolabe/node'

module Asterisk
module Astrolabe
describe Node, :ast do
describe '#parent' do
let(:source) { <<-END }
Expand Down
4 changes: 2 additions & 2 deletions spec/support/shared_contexts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
let(:root_node) do
fail '#source must be defined with #let' unless respond_to?(:source)

require 'asterisk/builder'
require 'astrolabe/builder'
require 'parser/current'

buffer = Parser::Source::Buffer.new('(string)')
buffer.source = source

builder = Asterisk::Builder.new
builder = Astrolabe::Builder.new
parser = Parser::CurrentRuby.new(builder)
parser.parse(buffer)
end
Expand Down

0 comments on commit 7fa22fa

Please sign in to comment.