Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create http_request resource #180

Merged

Conversation

hico-horiuchi
Copy link
Contributor

Create http_request resource for itamae.
This inherits file resource.
A example is shown in below.

http_request "/tmp/itamae.html" do
  headers "User-Agent" => "Ruby/#{RUBY_VERSION}"
  url "http://itamae.kitchen/"
end

@hico-horiuchi hico-horiuchi changed the title Create http request resource Create http_request resource Dec 7, 2015
@hico-horiuchi hico-horiuchi force-pushed the create-http_request-resource branch from 3dc08a5 to 9f03fda Compare December 7, 2015 21:35
@hico-horiuchi
Copy link
Contributor Author

I apologize for many fixes.
Should I rebase these commits?

@@ -70,6 +70,16 @@
it { should_not be_file }
end

describe file('/tmp/http_request.html') do
it { should be_file }
its(:content) { should match(/Itamae/) }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks assuming http://itamae.kitchen always return a body including Itamae but it can change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hico-horiuchi
Copy link
Contributor Author

That's great!
I'll use it.

@ryotarai
Copy link
Member

ryotarai commented Dec 8, 2015

Thank you for the fix. Would you rebase the commits?

@hico-horiuchi hico-horiuchi force-pushed the create-http_request-resource branch from ead3afa to 41776e3 Compare December 8, 2015 08:23
@hico-horiuchi
Copy link
Contributor Author

Thank you for reviewing.
I rebased the commits!

define_attribute :url, type: String

def pre_action
unless attributes.url
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

define_attribute accepts required option.

define_attribute :url, type: String, required: true

Instead of L13-L15, please use this.

@hico-horiuchi
Copy link
Contributor Author

Thank you for reviewing.
I fixed them.

ryotarai added a commit that referenced this pull request Dec 9, 2015
@ryotarai ryotarai merged commit c1a98b6 into itamae-kitchen:master Dec 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants