GitHub PullRequestReviewCommentEvent at 2014-05-30 03:49:53
Repository: rspec-core
Actor: cupakromer
Payload: {"comment":{"url":"https://api.github.com/repos/rspec/rspec-core/pulls/comments/13215722","id":13215722,"diff_hunk":"@@ -3,29 +3,40 @@ module Core\n     # @private\n     # Generates conventional files for an rspec project\n     class ProjectInitializer\n-      def run\n-        create_spec_helper_file\n-        create_dot_rspec_file\n+      attr_reader :verbose\n+\n+      def initialize(opts = {})\n+        @verbose = opts.fetch(:verbose) { true }\n+      end\n+\n+      def run(target_dir = nil)\n+        create_spec_helper_file target_dir\n+        create_dot_rspec_file target_dir\n       end\n \n-      def create_dot_rspec_file\n-        if File.exist?('.rspec')\n-          report_exists('.rspec')\n+      def create_dot_rspec_file(target_dir = nil)\n+        dot_rspec_file = '.rspec'\n+        dot_rspec_file = File.join(target_dir, dot_rspec_file) if target_dir","path":"lib/rspec/core/project_initializer.rb","position":23,"original_position":23,"commit_id":"7ed9c3360a7fd68f3b0776cd881373d079aea927","original_commit_id":"7ed9c3360a7fd68f3b0776cd881373d079aea927","user":{"login":"cupakromer","id":1524496,"avatar_url":"https://avatars.githubusercontent.com/u/1524496?","gravatar_id":"27a7b65804bca13793acd4b67fa32d83","url":"https://api.github.com/users/cupakromer","html_url":"https://github.com/cupakromer","followers_url":"https://api.github.com/users/cupakromer/followers","following_url":"https://api.github.com/users/cupakromer/following{/other_user}","gists_url":"https://api.github.com/users/cupakromer/gists{/gist_id}","starred_url":"https://api.github.com/users/cupakromer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cupakromer/subscriptions","organizations_url":"https://api.github.com/users/cupakromer/orgs","repos_url":"https://api.github.com/users/cupakromer/repos","events_url":"https://api.github.com/users/cupakromer/events{/privacy}","received_events_url":"https://api.github.com/users/cupakromer/received_events","type":"User","site_admin":false},"body":"The only reason I didn't default to anything was due not changing other code and not having the output change dramatically.\r\n\r\nUsing `Dir.pwd` provides the full path, which generates output of: `   exist /home/user/etc/etc/.rspec`. Likewise, providing './' would output: `   exist ./.rspec`. Those seemed odd to me. Though I'm not tired to this implementation at all.","created_at":"2014-05-30T03:49:53Z","updated_at":"2014-05-30T03:49:53Z","html_url":"https://github.com/rspec/rspec-core/pull/1563#discussion_r13215722","pull_request_url":"https://api.github.com/repos/rspec/rspec-core/pulls/1563","_links":{"self":{"href":"https://api.github.com/repos/rspec/rspec-core/pulls/comments/13215722"},"html":{"href":"https://github.com/rspec/rspec-core/pull/1563#discussion_r13215722"},"pull_request":{"href":"https://api.github.com/repos/rspec/rspec-core/pulls/1563"}}}}