Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Simple, immutable model for github webhooks.
Add this line to your application's Gemfile:
gem 'git_web_hook_model', '~> 0.0.3', group :development
And then execute:
$ bundle
Or install it yourself as:
$ gem install git_web_hook_model
GitWebHookModel accepts either a hash object or json string returned from Github's WebHook service and returns an immutable model object.
model = GitWebHookModel.for(github_json_response)
# => #<GitWebHookModel::Hook::Model:0x007fba946a8c08>
model.ref
# => "refs/heads/feature/ci"
model.after
# => "38209a615b72728ef4f3160619c7c63c37b8994c"
model.before
# => "0000000000000000000000000000000000000000"
model.created?
# => true
model.deleted?
# => false
model.forced?
# => true
model.compare
# => "https://github.company.com/organization/otb_www_app/commit/38209a615b72"
Commits Array
of GitWebHookModel::Hook::Commit
mode.commits
# => [#<GitWebHookModel::Hook::Commit:0x007fba94714200>]
Head Commit GitWebHookModel::Hook::Commit
mode.head_commit
# => #<GitWebHookModel::Hook::Commit:0x007fba94714200>
Pusher GitWebHookModel::Hook::Owner
mode.pusher
# => #<GitWebHookModel::Hook::Owner:0x007fba94714200>
Repository GitWebHookModel::Hook::Repository
model.repository.id
# => 72
model.repository.name
# => "otb_www_app"
model.repository.url
# => "https://github.company.com/organization/otb_www_app"
model.repository.description
# => "Frontend Application"
model.repository.homepage
# => "www.example.co.uk"
model.repository.watchers
# => 1
model.repository.stargazers
# => 1
model.repository.forks
# => 0
model.repository.fork?
# => false
model.repository.size
# => 54414
model.repository.owner
# => #<GitWebHookModel::Hook::Owner:0x007fba9483d028>
model.repository.private?
# => false
model.repository.open_issues
# => 6
model.repository.has_issues?
# => true
model.repository.has_downloads?
# => true
model.repository.has_wiki?
# => true
model.repository.language
# => "Ruby"
model.repository.created_at
# => 1295946304
model.repository.pushed_at
# => 1383924957
model.repository.master_branch
# => "master"
model.repository.organization
# => "organization"
Commit Object GitWebHookModel::Hook::Commit
obj.id
# => "38209a615b72728ef4f3160619c7c63c37b8994c"
obj.distinct?
# => true
obj.message
# => "Setup CI"
obj.timestamp
# => 2013-11-08T15:34:33+00:00
obj.url
# => "https://github.company.com/organization/otb_www_app/commit/38209a615b72728ef4f3160619c7c63c37b8994c"
obj.author
# => #<GitWebHookModel::Hook::Owner:0x007fba946f50a8>
obj.committer
# => #<GitWebHookModel::Hook::Owner:0x007fba946f50a8>
obj.added
# => [ "continuus_lenimentus.enc" ]
obj.removed
# => []
obj.modified
# => [ ".simplecov", "Gemfile", "Gemfile.lock", "spec/spec_helper_lite.rb" ]
Owner Object GitWebHookModel::Hook::Owner
obj.name
# => "Chuck J hardy"
obj.email
# => Some["chuckjhardy@gmail.com"] / None
obj.username
# => Some["charles-hardy"] / None
Sometimes fields are returned from Github as nil
. In these cases the objects return either Some[value]
or None
. Have a look at the Optional Gem for more information.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that git_web_hook_model demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.