Sha256: f8466a9b634cf25d0da594abd9f8f0a064fc258d37186a3264e112fbab9b78a3

Contents?: true

Size: 1.79 KB

Versions: 2

Compression:

Stored size: 1.79 KB

Contents

# Undead

Undead gets Dynamic HTML. Dynamic HTML are created by JavaScript.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'undead'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install undead

## Usage

### Get Dynamic HTML in Terminal

    $ undead http://example.com/

### Get Dynamic HTML in Ruby

`Undead.get` can get Dynamic HTML. `<script>` is evaluated, then HTML is created.

```ruby
response = Undead.get 'http://example.com/'  # GET http://example.com/

# Undead's response. The HTML p element is dynamicaly created.
# <!doctype html>
# <html>
# <head></head>
# <body>
#   <div id="main">
#     <p>Hello, World!</p>
#   </div>
#   <script>
#     var p = document.createElement("p");
#     var helloText = document.createTextNode("Hello, World!");
#     p.appendChild(helloText);
#     var main = document.getElementById("main");
#     main.appendChild(p);
#   </script>
# </body>

# Original response.
# <!doctype html>
# <html>
# <head></head>
# <body>
#   <div id="main"></div>
#   <script>
#     var p = document.createElement("p");
#     var helloText = document.createTextNode("Hello, World!");
#     p.appendChild(helloText);
#     var main = document.getElementById("main");
#     main.appendChild(p);
#   </script>
# </body>
```

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`.

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/south37/undead.


## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
undead-0.2.0 README.md
undead-0.1.1 README.md