{"action":"created","issue":{"url":"https://api.github.com/repos/lwf/puppet-remote_file/issues/21","labels_url":"https://api.github.com/repos/lwf/puppet-remote_file/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/lwf/puppet-remote_file/issues/21/comments","events_url":"https://api.github.com/repos/lwf/puppet-remote_file/issues/21/events","html_url":"https://github.com/lwf/puppet-remote_file/issues/21","id":94280869,"number":21,"title":"latest option is not supporting","user":{"login":"hussainaphroj","id":1503091,"avatar_url":"https://avatars.githubusercontent.com/u/1503091?v=3","gravatar_id":"","url":"https://api.github.com/users/hussainaphroj","html_url":"https://github.com/hussainaphroj","followers_url":"https://api.github.com/users/hussainaphroj/followers","following_url":"https://api.github.com/users/hussainaphroj/following{/other_user}","gists_url":"https://api.github.com/users/hussainaphroj/gists{/gist_id}","starred_url":"https://api.github.com/users/hussainaphroj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hussainaphroj/subscriptions","organizations_url":"https://api.github.com/users/hussainaphroj/orgs","repos_url":"https://api.github.com/users/hussainaphroj/repos","events_url":"https://api.github.com/users/hussainaphroj/events{/privacy}","received_events_url":"https://api.github.com/users/hussainaphroj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"lwf","id":572261,"avatar_url":"https://avatars.githubusercontent.com/u/572261?v=3","gravatar_id":"","url":"https://api.github.com/users/lwf","html_url":"https://github.com/lwf","followers_url":"https://api.github.com/users/lwf/followers","following_url":"https://api.github.com/users/lwf/following{/other_user}","gists_url":"https://api.github.com/users/lwf/gists{/gist_id}","starred_url":"https://api.github.com/users/lwf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lwf/subscriptions","organizations_url":"https://api.github.com/users/lwf/orgs","repos_url":"https://api.github.com/users/lwf/repos","events_url":"https://api.github.com/users/lwf/events{/privacy}","received_events_url":"https://api.github.com/users/lwf/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-07-10T10:40:32Z","updated_at":"2015-10-08T14:35:40Z","closed_at":null,"body":"Hi,\r\n\r\nI have a requirement to download a file from S3 bucket only when that file got modified, I have found your code very helpful but while using with ensure=>latest, throwing below error:\r\n\r\nRemote_file[/mnt/abc]/ensure: change from 2015-07-06T08:25:17-04:00 to latest failed: undefined method `close' for nil:NilClass\r\n\r\nremote_file { '/mnt/abc':\r\n        ensure   => latest,\r\n        source   => 'https://s3.amazonaws.com/abc/abc',\r\n      }\r\n\r\nI have tested with ensure=>present too but it is downloading only first time, I have modified the file on S3 and ran puppet , The latest file didn't get pulled .\r\n checksum attribute is also not getting supported.\r\n\r\nAny help will be appreciated.\r\nThanks,\r\nAfroz"},"comment":{"url":"https://api.github.com/repos/lwf/puppet-remote_file/issues/comments/146565159","html_url":"https://github.com/lwf/puppet-remote_file/issues/21#issuecomment-146565159","issue_url":"https://api.github.com/repos/lwf/puppet-remote_file/issues/21","id":146565159,"user":{"login":"tinsjourney","id":12034408,"avatar_url":"https://avatars.githubusercontent.com/u/12034408?v=3","gravatar_id":"","url":"https://api.github.com/users/tinsjourney","html_url":"https://github.com/tinsjourney","followers_url":"https://api.github.com/users/tinsjourney/followers","following_url":"https://api.github.com/users/tinsjourney/following{/other_user}","gists_url":"https://api.github.com/users/tinsjourney/gists{/gist_id}","starred_url":"https://api.github.com/users/tinsjourney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tinsjourney/subscriptions","organizations_url":"https://api.github.com/users/tinsjourney/orgs","repos_url":"https://api.github.com/users/tinsjourney/repos","events_url":"https://api.github.com/users/tinsjourney/events{/privacy}","received_events_url":"https://api.github.com/users/tinsjourney/received_events","type":"User","site_admin":false},"created_at":"2015-10-08T14:35:40Z","updated_at":"2015-10-08T14:35:40Z","body":"Found why it wasn't working for me.\r\nThe File::NULL is new to Ruby 1.9.3, but in RHEL6 it's Ruby 1.8.7\r\n\r\nSo the problem is with line 78\r\nnull = File.open(File::NULL)\r\n1.8 => uninitialized constant File::NULL\r\n\r\nLooking at ruby backport\r\nBackport 1.8 : (https://github.com/marcandre/backports)\r\n\r\nadding the following will fix the issue.\r\nunless File.const_defined? :NULL\r\n  module File::Constants\r\n    platform = RUBY_PLATFORM\r\n    platform = RbConfig::CONFIG['host_os'] if platform == 'java'\r\n    NULL =  case platform\r\n            when /mswin|mingw/i\r\n              'NUL'\r\n            when /amiga/i\r\n              'NIL:'\r\n            when /openvms/i\r\n              'NL:'\r\n            else\r\n              '/dev/null'\r\n            end\r\n  end\r\nend                 \r\n\r\nand it works !!!!"}}