From af770276e615e204a42770d3491d9e2c6a614d23 Mon Sep 17 00:00:00 2001
From: Merco
Date: Wed, 6 Dec 2017 16:49:02 -0800
Subject: [PATCH 001/159] Reformated
No offense, but it looked really ugly. FTFY
---
public/javascripts/translations.js | 513 ++++++++++++++++++++++++++++-
1 file changed, 512 insertions(+), 1 deletion(-)
diff --git a/public/javascripts/translations.js b/public/javascripts/translations.js
index 0f19fce3..52967aad 100644
--- a/public/javascripts/translations.js
+++ b/public/javascripts/translations.js
@@ -1,2 +1,513 @@
var I18n = I18n || {};
-I18n.translations = {"en":{"date":{"formats":{"default":"%Y-%m-%d","short":"%b %d","long":"%B %d, %Y"},"day_names":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"abbr_day_names":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"month_names":[null,"January","February","March","April","May","June","July","August","September","October","November","December"],"abbr_month_names":[null,"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"order":["year","month","day"]},"time":{"formats":{"default":"%a, %d %b %Y %H:%M:%S %z","short":"%d %b %H:%M","long":"%B %d, %Y %H:%M"},"am":"am","pm":"pm"},"support":{"array":{"words_connector":", ","two_words_connector":" and ","last_word_connector":", and "}},"number":{"format":{"separator":".","delimiter":",","precision":3,"significant":false,"strip_insignificant_zeros":false},"currency":{"format":{"format":"%u%n","unit":"$","separator":".","delimiter":",","precision":2,"significant":false,"strip_insignificant_zeros":false}},"percentage":{"format":{"delimiter":"","format":"%n%"}},"precision":{"format":{"delimiter":""}},"human":{"format":{"delimiter":"","precision":3,"significant":true,"strip_insignificant_zeros":true},"storage_units":{"format":"%n %u","units":{"byte":{"one":"Byte","other":"Bytes"},"kb":"KB","mb":"MB","gb":"GB","tb":"TB"}},"decimal_units":{"format":"%n %u","units":{"unit":"","thousand":"Thousand","million":"Million","billion":"Billion","trillion":"Trillion","quadrillion":"Quadrillion"}}}},"errors":{"format":"%{attribute} %{message}","messages":{"inclusion":"is not included in the list","exclusion":"is reserved","invalid":"is invalid","confirmation":"doesn't match %{attribute}","accepted":"must be accepted","empty":"can't be empty","blank":"can't be blank","present":"must be blank","too_long":"is too long (maximum is %{count} characters)","too_short":"is too short (minimum is %{count} characters)","wrong_length":"is the wrong length (should be %{count} characters)","not_a_number":"is not a number","not_an_integer":"must be an integer","greater_than":"must be greater than %{count}","greater_than_or_equal_to":"must be greater than or equal to %{count}","equal_to":"must be equal to %{count}","less_than":"must be less than %{count}","less_than_or_equal_to":"must be less than or equal to %{count}","other_than":"must be other than %{count}","odd":"must be odd","even":"must be even","taken":"has already been taken","already_confirmed":"was already confirmed, please try signing in","confirmation_period_expired":"needs to be confirmed within %{period}, please request a new one","expired":"has expired, please request a new one","not_found":"not found","not_locked":"was not locked","not_saved":{"one":"1 error prohibited this %{resource} from being saved:","other":"%{count} errors prohibited this %{resource} from being saved:"}},"project_not_found":"Project not found.","access_denied":"You are not authorized to perform this action!","can_assign_more_tips":"You can't assign more than 100% of available funds.","wrong_bitcoin_address":"Error updating bitcoin address","user_not_found":"User not found"},"activerecord":{"errors":{"messages":{"record_invalid":"Validation failed: %{errors}","restrict_dependent_destroy":{"one":"Cannot delete record because a dependent %{record} exists","many":"Cannot delete record because dependent %{record} exist"}}},"attributes":{"user":{"email":"E-mail","bitcoin_address":"Bitcoin address","password":"Password","password_confirmation":"Password confirmation"}}},"datetime":{"distance_in_words":{"half_a_minute":"half a minute","less_than_x_seconds":{"one":"less than 1 second","other":"less than %{count} seconds"},"x_seconds":{"one":"1 second","other":"%{count} seconds"},"less_than_x_minutes":{"one":"less than a minute","other":"less than %{count} minutes"},"x_minutes":{"one":"1 minute","other":"%{count} minutes"},"about_x_hours":{"one":"about 1 hour","other":"about %{count} hours"},"x_days":{"one":"1 day","other":"%{count} days"},"about_x_months":{"one":"about 1 month","other":"about %{count} months"},"x_months":{"one":"1 month","other":"%{count} months"},"about_x_years":{"one":"about 1 year","other":"about %{count} years"},"over_x_years":{"one":"over 1 year","other":"over %{count} years"},"almost_x_years":{"one":"almost 1 year","other":"almost %{count} years"}},"prompts":{"year":"Year","month":"Month","day":"Day","hour":"Hour","minute":"Minute","second":"Seconds"}},"helpers":{"select":{"prompt":"Please select"},"submit":{"create":"Create %{model}","update":"Update %{model}","submit":"Save %{model}"},"page_entries_info":{"one_page":{"display_entries":{"zero":"No %{entry_name} found","one":"Displaying \u003Cb\u003E1\u003C/b\u003E %{entry_name}","other":"Displaying \u003Cb\u003Eall %{count}\u003C/b\u003E %{entry_name}"}},"more_pages":{"display_entries":"Displaying %{entry_name} \u003Cb\u003E%{first}\u0026nbsp;-\u0026nbsp;%{last}\u003C/b\u003E of \u003Cb\u003E%{total}\u003C/b\u003E in total"}},"actions":"Actions","links":{"back":"Back","cancel":"Cancel","confirm":"Are you sure?","destroy":"Delete","new":"New","edit":"Edit"},"titles":{"edit":"Edit %{model}","save":"Save %{model}","new":"New %{model}","delete":"Delete %{model}"}},"views":{"pagination":{"first":"\u0026laquo; First","last":"Last \u0026raquo;","previous":"\u0026lsaquo; Prev","next":"Next \u0026rsaquo;","truncate":"\u0026hellip;"}},"devise":{"confirmations":{"confirmed":"Your account was successfully confirmed. Please sign in.","send_instructions":"You will receive an email with instructions about how to confirm your account in a few minutes.","send_paranoid_instructions":"If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes.","confirmed_and_signed_in":"Your account was successfully confirmed. You are now signed in.","new":{"title":"Resend confirmation instructions","submit":"Resend confirmation instructions"}},"failure":{"already_authenticated":"You are already signed in.","inactive":"Your account is not activated yet.","invalid":"Invalid email or password.","locked":"Your account is locked.","last_attempt":"You have one more attempt before your account will be locked.","not_found_in_database":"Invalid email or password.","timeout":"Your session expired. Please sign in again to continue.","unauthenticated":"You need to sign in or sign up before continuing.","unconfirmed":"You have to confirm your account before continuing.","invalid_token":"Invalid authentication token."},"mailer":{"confirmation_instructions":{"subject":"Confirmation instructions"},"reset_password_instructions":{"subject":"Reset password instructions"},"unlock_instructions":{"subject":"Unlock Instructions"}},"omniauth_callbacks":{"failure":"Could not authenticate you from %{kind} because \"%{reason}\".","success":"Successfully authenticated from %{kind} account."},"passwords":{"no_token":"You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided.","send_instructions":"You will receive an email with instructions about how to reset your password in a few minutes.","send_paranoid_instructions":"If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes.","updated":"Your password was changed successfully. You are now signed in.","updated_not_active":"Your password was changed successfully.","new":{"title":"Forgot your password?","submit":"Send me reset password instructions"},"edit":{"title":"Change your password","submit":"Change my password"}},"registrations":{"destroyed":"Bye! Your account was successfully cancelled. We hope to see you again soon.","signed_up":"Welcome! You have signed up successfully.","signed_up_but_inactive":"You have signed up successfully. However, we could not sign you in because your account is not yet activated.","signed_up_but_locked":"You have signed up successfully. However, we could not sign you in because your account is locked.","signed_up_but_unconfirmed":"A message with a confirmation link has been sent to your email address. Please open the link to activate your account.","update_needs_confirmation":"You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address.","updated":"You updated your account successfully.","new":{"title":"Sign up","submit":"Sign up"}},"sessions":{"signed_in":"Signed in successfully.","signed_out":"Signed out successfully.","new":{"title":"Sign in","remember_me":"Remember me","submit":"Sign in"}},"unlocks":{"send_instructions":"You will receive an email with instructions about how to unlock your account in a few minutes.","send_paranoid_instructions":"If your account exists, you will receive an email with instructions about how to unlock it in a few minutes.","unlocked":"Your account has been unlocked successfully. Please sign in to continue."},"links":{"sign_in":"Sign in","sign_up":"Sign up","recover":"Forgot your password?","confirm":"Didn't receive confirmation instructions?","sign_in_with":"Sign in with %{provider}"},"errors":{"primary_email":"your primary email address should be verified.","onmiauth_info":"we were unable to fetch your information."}},"tip4commit":"Tip4Commit","meta":{"title":"Contribute to Open Source","description":"Donate bitcoins to open source projects or make commits and get tips for it."},"menu":{"home":"Home","projects":"Supported Projects"},"footer":{"text":"Source code is available at %{github_link} and you can also %{support_link} its development.","github_link":"GitHub","support_link":"support","follow_link":"Follow @tip4commit"},"links":{"sign_in":"Sign in","sign_out":"Sign Out"},"notices":{"project_updated":"The project settings have been updated","tips_decided":"The tip amounts have been defined","user_updated":"Your information saved!","user_unsubscribed":"You unsubscribed! Sorry for bothering you. Although, you still can leave us your bitcoin address to get your tips."},"tip_amounts":{"undecided":"Undecided","free":"Free: 0%","tiny":"Tiny: 0.1%","small":"Small: 0.5%","normal":"Normal: 1%","big":"Big: 2%","huge":"Huge: 5%"},"home":{"index":{"see_projects":"See projects","how_does_it_work":{"title":"How does it work?","text":"People donate bitcoins to projects. When someone's commit is accepted into the project repository, we automatically tip the author.","button":"Learn about Bitcoin"},"donate":{"title":"Donate","text":"Find a project you like and deposit bitcoins into it. Your donation will be accumulated with the funds of other donators to give as tips for new commits.","button":"Find or add a project"},"contribute":{"title":"Contribute","text":"Go and fix something! If your commit is accepted by the project maintainer, you will get a tip!","sign_in_text":"Just check your email or %{sign_in_link}.","button":"Supported projects"}}},"projects":{"index":{"find_project":{"placeholder":"Enter GitHub project URL to find or add a project e.g. rails/rails","button":"Find or add project"},"repository":"Repository","description":"Description","watchers":"Watchers","balance":"Balance","forked_from":"forked from","support":"Support"},"show":{"title":"Contribute to %{project}","edit_project":"Change project settings","decide_tip_amounts":"Decide tip amounts","project_sponsors":"Project Sponsors","fee":"%{percentage} of deposited funds will be used to tip for new commits.","balance":"Balance","custom_tip_size":"(each new commit receives a percentage of available balance)","default_tip_size":"(each new commit receives %{percentage} of available balance)","unconfirmed_amount":"(%{amount} unconfirmed)","tipping_policies":"Tipping policies","updated_by_user":"(Last updated by %{name} on %{date})","updated_by_unknown":"(Last updated on %{date})","tips_paid":"Tips Paid","unclaimed_amount":"(%{amount} of this is unclaimed, and will be refunded to the project after being unclaimed for 1 month.)","last_tips":"Last Tips","see_all":"see all","received":"received %{amount}","will_receive":"will receive a tip","for_commit":"for commit","when_decided":"when its amount is decided","next_tip":"Next Tip","contribute_and_earn":"Contribute and Earn","cocontribute_and_earn_description":"Donate bitcoins to this project or %{make_commits_link} and get tips for it. If your commit is accepted by the project maintainer and there are bitcoins on its balance, you will get a tip!","make_commits_link":"make commits","tell_us_bitcoin_address":"Just %{tell_us_link} your bitcoin address.","tell_us_link":"tell us","sign_in":"Just check your email or %{sign_in_link}.","promote_project":"Promote %{project}","embedding":"Embedding","image_url":"Image URL:","shield_title":"tip for next commit"},"edit":{"project_settings":"%{project} project settings","tipping_policies":"Tipping policies","hold_tips":"Do not send the tips immediatly. Give collaborators the ability to modify the tips before they're sent","save":"Save the project settings"},"decide_tip_amounts":{"commit":"Commit","author":"Author","message":"Message","tip":"Tip (relative to the project balance)","submit":"Send the selected tip amounts"}},"tips":{"index":{"tips":"Tips","project_tips":"%{project} tips","user_tips":"%{user} tips","created_at":"Created At","commiter":"Commiter","project":"Project","commit":"Commit","amount":"Amount","refunded":"Refunded to project's deposit","undecided":"The amount of the tip has not been decided yet","no_bitcoin_address":"User didn't specify withdrawal address","below_threshold":"User's balance is below withdrawal threshold","waiting":"Waiting for withdrawal","error":"(error sending transaction)"}},"users":{"index":{"title":"Top Contributors","name":"Name","commits_count":"Commits tipped","withdrawn":"Withdrawn"},"show":{"balance":"Balance","threshold":"You will get your money when your balance hits the threshold of %{threshold}","see_all":"see all","received":"%{time} received %{amount} for commit %{commit} in %{project}","bitcoin_address_placeholder":"Your bitcoin address","notify":"Notify me about new tips (no more than one email per month)","submit_bitcoin_address":"Update Bitcoin address","change_password":"Change your password","submit_password":"Change my password"}},"withdrawals":{"index":{"title":"Last Withdrawals","created_at":"Created At","transaction":"Transaction","result":"Result","error":"Error","success":"Success"}}}};
\ No newline at end of file
+I18n.translations = {
+ "en": {
+ "date": {
+ "formats": {
+ "default": "%Y-%m-%d",
+ "short": "%b %d",
+ "long": "%B %d, %Y"
+ },
+ "day_names": ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
+ "abbr_day_names": ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
+ "month_names": [null, "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
+ "abbr_month_names": [null, "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
+ "order": ["year", "month", "day"]
+ },
+ "time": {
+ "formats": {
+ "default": "%a, %d %b %Y %H:%M:%S %z",
+ "short": "%d %b %H:%M",
+ "long": "%B %d, %Y %H:%M"
+ },
+ "am": "am",
+ "pm": "pm"
+ },
+ "support": {
+ "array": {
+ "words_connector": ", ",
+ "two_words_connector": " and ",
+ "last_word_connector": ", and "
+ }
+ },
+ "number": {
+ "format": {
+ "separator": ".",
+ "delimiter": ",",
+ "precision": 3,
+ "significant": false,
+ "strip_insignificant_zeros": false
+ },
+ "currency": {
+ "format": {
+ "format": "%u%n",
+ "unit": "$",
+ "separator": ".",
+ "delimiter": ",",
+ "precision": 2,
+ "significant": false,
+ "strip_insignificant_zeros": false
+ }
+ },
+ "percentage": {
+ "format": {
+ "delimiter": "",
+ "format": "%n%"
+ }
+ },
+ "precision": {
+ "format": {
+ "delimiter": ""
+ }
+ },
+ "human": {
+ "format": {
+ "delimiter": "",
+ "precision": 3,
+ "significant": true,
+ "strip_insignificant_zeros": true
+ },
+ "storage_units": {
+ "format": "%n %u",
+ "units": {
+ "byte": {
+ "one": "Byte",
+ "other": "Bytes"
+ },
+ "kb": "KB",
+ "mb": "MB",
+ "gb": "GB",
+ "tb": "TB"
+ }
+ },
+ "decimal_units": {
+ "format": "%n %u",
+ "units": {
+ "unit": "",
+ "thousand": "Thousand",
+ "million": "Million",
+ "billion": "Billion",
+ "trillion": "Trillion",
+ "quadrillion": "Quadrillion"
+ }
+ }
+ }
+ },
+ "errors": {
+ "format": "%{attribute} %{message}",
+ "messages": {
+ "inclusion": "is not included in the list",
+ "exclusion": "is reserved",
+ "invalid": "is invalid",
+ "confirmation": "doesn't match %{attribute}",
+ "accepted": "must be accepted",
+ "empty": "can't be empty",
+ "blank": "can't be blank",
+ "present": "must be blank",
+ "too_long": "is too long (maximum is %{count} characters)",
+ "too_short": "is too short (minimum is %{count} characters)",
+ "wrong_length": "is the wrong length (should be %{count} characters)",
+ "not_a_number": "is not a number",
+ "not_an_integer": "must be an integer",
+ "greater_than": "must be greater than %{count}",
+ "greater_than_or_equal_to": "must be greater than or equal to %{count}",
+ "equal_to": "must be equal to %{count}",
+ "less_than": "must be less than %{count}",
+ "less_than_or_equal_to": "must be less than or equal to %{count}",
+ "other_than": "must be other than %{count}",
+ "odd": "must be odd",
+ "even": "must be even",
+ "taken": "has already been taken",
+ "already_confirmed": "was already confirmed, please try signing in",
+ "confirmation_period_expired": "needs to be confirmed within %{period}, please request a new one",
+ "expired": "has expired, please request a new one",
+ "not_found": "not found",
+ "not_locked": "was not locked",
+ "not_saved": {
+ "one": "1 error prohibited this %{resource} from being saved:",
+ "other": "%{count} errors prohibited this %{resource} from being saved:"
+ }
+ },
+ "project_not_found": "Project not found.",
+ "access_denied": "You are not authorized to perform this action!",
+ "can_assign_more_tips": "You can't assign more than 100% of available funds.",
+ "wrong_bitcoin_address": "Error updating bitcoin address",
+ "user_not_found": "User not found"
+ },
+ "activerecord": {
+ "errors": {
+ "messages": {
+ "record_invalid": "Validation failed: %{errors}",
+ "restrict_dependent_destroy": {
+ "one": "Cannot delete record because a dependent %{record} exists",
+ "many": "Cannot delete record because dependent %{record} exist"
+ }
+ }
+ },
+ "attributes": {
+ "user": {
+ "email": "E-mail",
+ "bitcoin_address": "Bitcoin address",
+ "password": "Password",
+ "password_confirmation": "Password confirmation"
+ }
+ }
+ },
+ "datetime": {
+ "distance_in_words": {
+ "half_a_minute": "half a minute",
+ "less_than_x_seconds": {
+ "one": "less than 1 second",
+ "other": "less than %{count} seconds"
+ },
+ "x_seconds": {
+ "one": "1 second",
+ "other": "%{count} seconds"
+ },
+ "less_than_x_minutes": {
+ "one": "less than a minute",
+ "other": "less than %{count} minutes"
+ },
+ "x_minutes": {
+ "one": "1 minute",
+ "other": "%{count} minutes"
+ },
+ "about_x_hours": {
+ "one": "about 1 hour",
+ "other": "about %{count} hours"
+ },
+ "x_days": {
+ "one": "1 day",
+ "other": "%{count} days"
+ },
+ "about_x_months": {
+ "one": "about 1 month",
+ "other": "about %{count} months"
+ },
+ "x_months": {
+ "one": "1 month",
+ "other": "%{count} months"
+ },
+ "about_x_years": {
+ "one": "about 1 year",
+ "other": "about %{count} years"
+ },
+ "over_x_years": {
+ "one": "over 1 year",
+ "other": "over %{count} years"
+ },
+ "almost_x_years": {
+ "one": "almost 1 year",
+ "other": "almost %{count} years"
+ }
+ },
+ "prompts": {
+ "year": "Year",
+ "month": "Month",
+ "day": "Day",
+ "hour": "Hour",
+ "minute": "Minute",
+ "second": "Seconds"
+ }
+ },
+ "helpers": {
+ "select": {
+ "prompt": "Please select"
+ },
+ "submit": {
+ "create": "Create %{model}",
+ "update": "Update %{model}",
+ "submit": "Save %{model}"
+ },
+ "page_entries_info": {
+ "one_page": {
+ "display_entries": {
+ "zero": "No %{entry_name} found",
+ "one": "Displaying \u003Cb\u003E1\u003C/b\u003E %{entry_name}",
+ "other": "Displaying \u003Cb\u003Eall %{count}\u003C/b\u003E %{entry_name}"
+ }
+ },
+ "more_pages": {
+ "display_entries": "Displaying %{entry_name} \u003Cb\u003E%{first}\u0026nbsp;-\u0026nbsp;%{last}\u003C/b\u003E of \u003Cb\u003E%{total}\u003C/b\u003E in total"
+ }
+ },
+ "actions": "Actions",
+ "links": {
+ "back": "Back",
+ "cancel": "Cancel",
+ "confirm": "Are you sure?",
+ "destroy": "Delete",
+ "new": "New",
+ "edit": "Edit"
+ },
+ "titles": {
+ "edit": "Edit %{model}",
+ "save": "Save %{model}",
+ "new": "New %{model}",
+ "delete": "Delete %{model}"
+ }
+ },
+ "views": {
+ "pagination": {
+ "first": "\u0026laquo; First",
+ "last": "Last \u0026raquo;",
+ "previous": "\u0026lsaquo; Prev",
+ "next": "Next \u0026rsaquo;",
+ "truncate": "\u0026hellip;"
+ }
+ },
+ "devise": {
+ "confirmations": {
+ "confirmed": "Your account was successfully confirmed. Please sign in.",
+ "send_instructions": "You will receive an email with instructions about how to confirm your account in a few minutes.",
+ "send_paranoid_instructions": "If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes.",
+ "confirmed_and_signed_in": "Your account was successfully confirmed. You are now signed in.",
+ "new": {
+ "title": "Resend confirmation instructions",
+ "submit": "Resend confirmation instructions"
+ }
+ },
+ "failure": {
+ "already_authenticated": "You are already signed in.",
+ "inactive": "Your account is not activated yet.",
+ "invalid": "Invalid email or password.",
+ "locked": "Your account is locked.",
+ "last_attempt": "You have one more attempt before your account will be locked.",
+ "not_found_in_database": "Invalid email or password.",
+ "timeout": "Your session expired. Please sign in again to continue.",
+ "unauthenticated": "You need to sign in or sign up before continuing.",
+ "unconfirmed": "You have to confirm your account before continuing.",
+ "invalid_token": "Invalid authentication token."
+ },
+ "mailer": {
+ "confirmation_instructions": {
+ "subject": "Confirmation instructions"
+ },
+ "reset_password_instructions": {
+ "subject": "Reset password instructions"
+ },
+ "unlock_instructions": {
+ "subject": "Unlock Instructions"
+ }
+ },
+ "omniauth_callbacks": {
+ "failure": "Could not authenticate you from %{kind} because \"%{reason}\".",
+ "success": "Successfully authenticated from %{kind} account."
+ },
+ "passwords": {
+ "no_token": "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided.",
+ "send_instructions": "You will receive an email with instructions about how to reset your password in a few minutes.",
+ "send_paranoid_instructions": "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes.",
+ "updated": "Your password was changed successfully. You are now signed in.",
+ "updated_not_active": "Your password was changed successfully.",
+ "new": {
+ "title": "Forgot your password?",
+ "submit": "Send me reset password instructions"
+ },
+ "edit": {
+ "title": "Change your password",
+ "submit": "Change my password"
+ }
+ },
+ "registrations": {
+ "destroyed": "Bye! Your account was successfully cancelled. We hope to see you again soon.",
+ "signed_up": "Welcome! You have signed up successfully.",
+ "signed_up_but_inactive": "You have signed up successfully. However, we could not sign you in because your account is not yet activated.",
+ "signed_up_but_locked": "You have signed up successfully. However, we could not sign you in because your account is locked.",
+ "signed_up_but_unconfirmed": "A message with a confirmation link has been sent to your email address. Please open the link to activate your account.",
+ "update_needs_confirmation": "You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address.",
+ "updated": "You updated your account successfully.",
+ "new": {
+ "title": "Sign up",
+ "submit": "Sign up"
+ }
+ },
+ "sessions": {
+ "signed_in": "Signed in successfully.",
+ "signed_out": "Signed out successfully.",
+ "new": {
+ "title": "Sign in",
+ "remember_me": "Remember me",
+ "submit": "Sign in"
+ }
+ },
+ "unlocks": {
+ "send_instructions": "You will receive an email with instructions about how to unlock your account in a few minutes.",
+ "send_paranoid_instructions": "If your account exists, you will receive an email with instructions about how to unlock it in a few minutes.",
+ "unlocked": "Your account has been unlocked successfully. Please sign in to continue."
+ },
+ "links": {
+ "sign_in": "Sign in",
+ "sign_up": "Sign up",
+ "recover": "Forgot your password?",
+ "confirm": "Didn't receive confirmation instructions?",
+ "sign_in_with": "Sign in with %{provider}"
+ },
+ "errors": {
+ "primary_email": "your primary email address should be verified.",
+ "onmiauth_info": "we were unable to fetch your information."
+ }
+ },
+ "tip4commit": "Tip4Commit",
+ "meta": {
+ "title": "Contribute to Open Source",
+ "description": "Donate bitcoins to open source projects or make commits and get tips for it."
+ },
+ "menu": {
+ "home": "Home",
+ "projects": "Supported Projects"
+ },
+ "footer": {
+ "text": "Source code is available at %{github_link} and you can also %{support_link} its development.",
+ "github_link": "GitHub",
+ "support_link": "support",
+ "follow_link": "Follow @tip4commit"
+ },
+ "links": {
+ "sign_in": "Sign in",
+ "sign_out": "Sign Out"
+ },
+ "notices": {
+ "project_updated": "The project settings have been updated",
+ "tips_decided": "The tip amounts have been defined",
+ "user_updated": "Your information saved!",
+ "user_unsubscribed": "You unsubscribed! Sorry for bothering you. Although, you still can leave us your bitcoin address to get your tips."
+ },
+ "tip_amounts": {
+ "undecided": "Undecided",
+ "free": "Free: 0%",
+ "tiny": "Tiny: 0.1%",
+ "small": "Small: 0.5%",
+ "normal": "Normal: 1%",
+ "big": "Big: 2%",
+ "huge": "Huge: 5%"
+ },
+ "home": {
+ "index": {
+ "see_projects": "See projects",
+ "how_does_it_work": {
+ "title": "How does it work?",
+ "text": "People donate bitcoins to projects. When someone's commit is accepted into the project repository, we automatically tip the author.",
+ "button": "Learn about Bitcoin"
+ },
+ "donate": {
+ "title": "Donate",
+ "text": "Find a project you like and deposit bitcoins into it. Your donation will be accumulated with the funds of other donators to give as tips for new commits.",
+ "button": "Find or add a project"
+ },
+ "contribute": {
+ "title": "Contribute",
+ "text": "Go and fix something! If your commit is accepted by the project maintainer, you will get a tip!",
+ "sign_in_text": "Just check your email or %{sign_in_link}.",
+ "button": "Supported projects"
+ }
+ }
+ },
+ "projects": {
+ "index": {
+ "find_project": {
+ "placeholder": "Enter GitHub project URL to find or add a project e.g. rails/rails",
+ "button": "Find or add project"
+ },
+ "repository": "Repository",
+ "description": "Description",
+ "watchers": "Watchers",
+ "balance": "Balance",
+ "forked_from": "forked from",
+ "support": "Support"
+ },
+ "show": {
+ "title": "Contribute to %{project}",
+ "edit_project": "Change project settings",
+ "decide_tip_amounts": "Decide tip amounts",
+ "project_sponsors": "Project Sponsors",
+ "fee": "%{percentage} of deposited funds will be used to tip for new commits.",
+ "balance": "Balance",
+ "custom_tip_size": "(each new commit receives a percentage of available balance)",
+ "default_tip_size": "(each new commit receives %{percentage} of available balance)",
+ "unconfirmed_amount": "(%{amount} unconfirmed)",
+ "tipping_policies": "Tipping policies",
+ "updated_by_user": "(Last updated by %{name} on %{date})",
+ "updated_by_unknown": "(Last updated on %{date})",
+ "tips_paid": "Tips Paid",
+ "unclaimed_amount": "(%{amount} of this is unclaimed, and will be refunded to the project after being unclaimed for 1 month.)",
+ "last_tips": "Last Tips",
+ "see_all": "see all",
+ "received": "received %{amount}",
+ "will_receive": "will receive a tip",
+ "for_commit": "for commit",
+ "when_decided": "when its amount is decided",
+ "next_tip": "Next Tip",
+ "contribute_and_earn": "Contribute and Earn",
+ "cocontribute_and_earn_description": "Donate bitcoins to this project or %{make_commits_link} and get tips for it. If your commit is accepted by the project maintainer and there are bitcoins on its balance, you will get a tip!",
+ "make_commits_link": "make commits",
+ "tell_us_bitcoin_address": "Just %{tell_us_link} your bitcoin address.",
+ "tell_us_link": "tell us",
+ "sign_in": "Just check your email or %{sign_in_link}.",
+ "promote_project": "Promote %{project}",
+ "embedding": "Embedding",
+ "image_url": "Image URL:",
+ "shield_title": "tip for next commit"
+ },
+ "edit": {
+ "project_settings": "%{project} project settings",
+ "tipping_policies": "Tipping policies",
+ "hold_tips": "Do not send the tips immediatly. Give collaborators the ability to modify the tips before they're sent",
+ "save": "Save the project settings"
+ },
+ "decide_tip_amounts": {
+ "commit": "Commit",
+ "author": "Author",
+ "message": "Message",
+ "tip": "Tip (relative to the project balance)",
+ "submit": "Send the selected tip amounts"
+ }
+ },
+ "tips": {
+ "index": {
+ "tips": "Tips",
+ "project_tips": "%{project} tips",
+ "user_tips": "%{user} tips",
+ "created_at": "Created At",
+ "commiter": "Commiter",
+ "project": "Project",
+ "commit": "Commit",
+ "amount": "Amount",
+ "refunded": "Refunded to project's deposit",
+ "undecided": "The amount of the tip has not been decided yet",
+ "no_bitcoin_address": "User didn't specify withdrawal address",
+ "below_threshold": "User's balance is below withdrawal threshold",
+ "waiting": "Waiting for withdrawal",
+ "error": "(error sending transaction)"
+ }
+ },
+ "users": {
+ "index": {
+ "title": "Top Contributors",
+ "name": "Name",
+ "commits_count": "Commits tipped",
+ "withdrawn": "Withdrawn"
+ },
+ "show": {
+ "balance": "Balance",
+ "threshold": "You will get your money when your balance hits the threshold of %{threshold}",
+ "see_all": "see all",
+ "received": "%{time} received %{amount} for commit %{commit} in %{project}",
+ "bitcoin_address_placeholder": "Your bitcoin address",
+ "notify": "Notify me about new tips (no more than one email per month)",
+ "submit_bitcoin_address": "Update Bitcoin address",
+ "change_password": "Change your password",
+ "submit_password": "Change my password"
+ }
+ },
+ "withdrawals": {
+ "index": {
+ "title": "Last Withdrawals",
+ "created_at": "Created At",
+ "transaction": "Transaction",
+ "result": "Result",
+ "error": "Error",
+ "success": "Success"
+ }
+ }
+ }
+};
From 3fc45979e69c32b636713e7bc3365e128d649619 Mon Sep 17 00:00:00 2001
From: Merco
Date: Wed, 6 Dec 2017 16:56:58 -0800
Subject: [PATCH 002/159] Upload Spanish Flag for Spanish
Since Spanish is available as a language, a quick image of the Spain Flag, commonly tied with Spanish language.
---
app/assets/images/flags/es.png | Bin 0 -> 338 bytes
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 app/assets/images/flags/es.png
diff --git a/app/assets/images/flags/es.png b/app/assets/images/flags/es.png
new file mode 100644
index 0000000000000000000000000000000000000000..fb67bf4ed1a61abb1cee701cb1f2a42d7cba0aaf
GIT binary patch
literal 338
zcmV-Y0j>UtP)DqGsWIgNiCGYJj8cnT@0001eNklL|U-Wq9BOiu7LXg-$~-pIc4UM1mKU=LRHmuXZPD|W0oL;)=8<9(gxN$
z?>{3UVid(eoN{=-+L^>9ZbiQ203%UVx3GZ(j`9XyM
k*8Z-_Sq_3R&bg5J0uGD_JJY|q#Q*>R07*qoM6N<$g1f(;{{R30
literal 0
HcmV?d00001
From fea0931864f1336ab9ec5ca503be3fc08c5b8cde Mon Sep 17 00:00:00 2001
From: Merco
Date: Wed, 6 Dec 2017 17:01:35 -0800
Subject: [PATCH 003/159] Added Spanish to available languages
Added Spanish to locale, enabling its use.
---
config/application.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/application.rb b/config/application.rb
index 69ca1e2a..c8223951 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -25,7 +25,7 @@ class Application < Rails::Application
config.autoload_paths += %W[#{config.root}/lib]
config.assets.initialize_on_precompile = true
- config.available_locales = %w[en fr nl ru pl hr de ro ko]
+ config.available_locales = %w[en es fr nl ru pl hr de ro ko]
config.active_job.queue_adapter = :sidekiq
end
end
From da4aa19127f090268c9b8ef40457bf721a8a5ca8 Mon Sep 17 00:00:00 2001
From: Merco
Date: Wed, 6 Dec 2017 17:45:32 -0800
Subject: [PATCH 004/159] Fixed some grammar.
---
config/locales/en.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 197f1925..6ba186f1 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -19,7 +19,7 @@ en:
create_issue: create an issue
errors:
project_not_found: Project not found.
- opt_in_notice: "Due to complaints from project maintainers we don't add projects automatically anymore. Existing projects without deposits have been removed. If you want to add your project, please %{create_issue_link}."
+ opt_in_notice: "Due to complaints from project maintainers, we don't add projects automatically anymore. Existing projects without deposits have been removed. If you want to add your project, please %{create_issue_link}."
access_denied: Access denied
can_assign_more_tips: "You can't assign more than 100% of available funds."
wrong_bitcoin_address: Error updating bitcoin address
@@ -29,7 +29,7 @@ en:
project_updated: The project settings have been updated
tips_decided: The tip amounts have been defined
user_updated: Your information saved!
- user_unsubscribed: "You unsubscribed! Sorry for bothering you. Although, you still can leave us your bitcoin address to get your tips."
+ user_unsubscribed: "You unsubscribed! Sorry for bothering you. Although, you can still leave us your bitcoin address to get your tips."
tip_amounts:
undecided: "Undecided"
free: "Free: 0%"
From b9d06b97afbaf2ca80a53fd4323a250485fbb4c0 Mon Sep 17 00:00:00 2001
From: Merco
Date: Wed, 6 Dec 2017 23:30:17 -0800
Subject: [PATCH 005/159] Added Spanish
This adds Spanish as an available language. It is not perfect but is accurate overall. It will receive minor updates in the future.
---
config/locales/es.txt | 233 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 233 insertions(+)
create mode 100644 config/locales/es.txt
diff --git a/config/locales/es.txt b/config/locales/es.txt
new file mode 100644
index 00000000..f3599582
--- /dev/null
+++ b/config/locales/es.txt
@@ -0,0 +1,233 @@
+es:
+ tip4commit: Tip4Commit
+ meta:
+ title: Contribuye a c¢digo abierto
+ description: Dona Bitcoins a proyectos de c¢digo abierto o haz commits y recibe propinas por ellos.
+ menu:
+ home: Inicio
+ projects: Proyectos soportados
+ footer:
+ text: "El c¢digo fuente est disponible en %{github_link} y tambi‚n puedes %{support_link} su desarollo."
+ github_link: GitHub
+ support_link: apoyar
+ follow_link: S¡guenos en @tip4commit
+ links:
+ sign_up: registrar
+ sign_in: inicia sesi¢n
+ sign_in_imp: inicie sesi¢n
+ sign_out: Cerrar Sesi¢n
+ create_issue: crea un problema
+ errors:
+ project_not_found: El proyecto no fue encontrado.
+ opt_in_notice: "Debido a varias quejas de mantenedores de proyectos, no agregamos proyectos autom ticamente. Proyectos existentes sin dep¢sitos han sido removidos. Si usted quiere agregar su proyecto, por favor %{create_issue_link}.
+ access_denied: Acceso rechazado
+ can_assign_more_tips: "No puede asignar m s de 100% de los fondos disponibles."
+ wrong_bitcoin_address: Ocurri¢ un error al actualizar su direcci¢n de bitcoin
+ user_not_found: No se pudo encontrar el usuario
+ access_denied: Usted no est autorizado para realizar esa acci¢n!
+ notices:
+ project_updated: Las configuraciones de su proyecto fueron actualizadas.
+ tips_decided: La cantidad de propina ha sido definida.
+ user_updated: La informaci¢n ha sido actualizada.
+ user_unsubscribed: "Usted ya no recibir notificaciones de nosotros. Nos disculpamos por haberte molestado. Pero a£n puede dejar su direcci¢n de bitcoin para recibir sus propinas."
+ tip_amounts:
+ undecided: "Indeciso"
+ free: "Gratis: 0%"
+ tiny: "Diminuto: 0.1%"
+ small: "Peque¤o: 0.5%"
+ normal: "Normal: 1%"
+ big: "Grande: 2%"
+ huge: "Enorme: 5%"
+ js:
+ errors:
+ value:
+ invalid: Valor no v lido.
+ email:
+ invalid: Correo electr¢nico no v lido.
+ blank: El correo electr¢nico es requerido y no puede dejarlo en blanco.
+ password:
+ blank: La contrase¤a es requerida y no puede dejarlo en blanco.
+ invalid: Su contrase¤a no es igual a la contrase¤a de confirmaci¢n.
+ password_confirmation:
+ blank: La contrase¤a de confirmaci¢n es requerida y no puede dejarlo en blanco.
+ invalid: Su contrase¤a no es igual a la contrase¤a de confirmaci¢n.
+ home:
+ index:
+ see_projects: Ver proyectos
+ how_does_it_work:
+ title: ¨Como funciona?
+ text: La gente dona bitcoin a proyectos. Cuando el commit de alguien es agregada al proyecto, nosotros autom ticamente le damos una propina al autor.
+ button: Aprende m s sobre Bitcoin
+ donate:
+ title: Haz donaciones
+ text: Encuentra un proyecto que te guste y d¢nale bitcoins. Su donaci¢n ser acumulada con los fondos de otros donadores para poder darse como propinas para nuevos commits.
+ button: Busca o agrega un proyecto
+ contribute:
+ title: Contribuye
+ text: Ve y arregla algo. Si tu commit es aceptado por el mantenedor del proyecto, recibir s una propina!
+ sign_in_text: "Solo cheque su bandeja por una invitaci¢n o %{sign_in_link}."
+ sign_up_text: "Si usted a£n no ha recibido una invitaci¢n, se puede %{sign_up_link} con un correo electr¢nico valido."
+ button: Proyectos soportados
+ projects:
+ index:
+ find_project:
+ placeholder: Enlace hacia un proyecto de GitHub o busque
+ button: Busca proyecto
+ repository: Repositorio
+ description: Descripci¢n
+ watchers: Seguidores
+ balance: Balance
+ forked_from: copiado de
+ support: Soporta este proyecto
+ show:
+ title: "Contribuye a %{project} "
+ fetch_pending: (Obtenci¢n inicial pendiente)
+ edit_project: Cambiar ajustes del proyecto
+ decide_tip_amounts: Decide cantidad de propina
+ disabled_notifications: "Mantenedores de proyectos han decidido no notificarles a nuevos contribuidores sobre las propinas y probablemente no les guste esta manera de financiamiento."
+ fee: "%{percentage} de los fondos ser n usados como propinas para nuevos commits."
+ balance: Balance
+ deposits: depositos
+ custom_tip_size: (cada nuevo commit recibe un porcentaje del balance disponible)
+ default_tip_size: "(cada nuevo commit recibe %{percentage} del balance disponible)"
+ min_tip_size: "La propina m¡nima es de %{min_tip}, pero si el balance disponible es menor de la propina m¡nima, una propina m s peque¤a ser enviada"
+ unconfirmed_amount: "(%{amount} no confirmado)"
+ tipping_policies: Pol¡tica de propina
+ updated_by_user: "(Ultimo cambio por %{name} el %{date})"
+ updated_by_unknown: "(Ultimo cambio el %{date})"
+ tips_paid: Propinas pagadas
+ unclaimed_amount: "(%{amount} no han sido reclamado, y ser devuelto al proyecto despu‚s de un mes sin reclamacion.)"
+ last_tips: Ultimas propinas
+ see_all: Ver todas
+ received: "%{amount} recibi¢"
+ will_receive: recibir una propina de
+ for_commit: por el commit
+ when_decided: cuando la cantidad sea decidida
+ next_tip: Siguiente Propina
+ contribute_and_earn: Contribuye y Gana
+ contribute_and_earn_description: "Dona Bitcoins a este proyecto o %{make_commits_link} y recibe propinas por ellos. Si tu commit es aceptado %{branch} por un mantenedor de proyecto y hay Bitcoins disponibles, recibir s una propina!"
+ contribute_and_earn_branch: "al %{branch} branch"
+ make_commits_link: haz commits
+ tell_us_bitcoin_address: Solo %{tell_us_link} su direcci¢n de Bitcoin.
+ tell_us_link: d¡ganos
+ sign_in: "Solo cheque su bandeja o %{sign_in_link}."
+ promote_project: Promueve %{project}
+ embedding: Integraciones
+ image_url: "Enlace de Imagen:"
+ shield_title: propina para siguiente commit
+ edit:
+ project_settings: "Ajustes del proyecto %{project} "
+ branch: Branch
+ default_branch: Branch predeterminado
+ tipping_policies: Pol¡tica de propina
+ hold_tips: "No envi‚ las propinas inmediatamente. Dele a los colaboradores la habilidad de modificar las propinas antes que sean enviadas"
+ save: Actualizar ajustes del proyecto
+ disable_notifications: No notifique a nuevos contribuidores
+ decide_tip_amounts:
+ commit: Commit
+ author: Autor
+ message: Mensaje
+ tip: Propina (relativo al balance del proyecto)
+ submit: Envia las propinas seleccionadas
+ blacklisted:
+ title: Lo sentimos mucho, pero esto proyecto no acepta propinas.
+ message: El autor de este proyecto ha deshabilitado propinas para este proyecto.
+ tips:
+ index:
+ tips: Consejos
+ project_tips: 'Consejos de %{project}'
+ user_tips: "Consejos de %{user}"
+ created_at: Creado en
+ commiter: Commiter
+ project: Proyecto
+ commit: Commit
+ amount: Cantidad
+ refunded: Reembolsado al dep¢sito del proyecto
+ undecided: La cantidad de la propina a£n no se ha decidido
+ no_bitcoin_address: El usuario no especifico una direcci¢n de deposito
+ below_threshold: "El saldo del usuario no ha superado el umbral de retiro "
+ waiting: Esperando por el retiro
+ error: (error al procesar la transacci¢n)
+ deposits:
+ index:
+ project_deposits: 'Dep¢sitos de %{project}'
+ deposits: Dep¢sitos
+ created_at: Creado en
+ project: Proyecto
+ amount: Cantidad
+ transaction: Transacci¢n
+ confirmed: Confirmado
+ confirmed_yes: 'Si'
+ confirmed_no: 'No'
+ users:
+ index:
+ title: Mayores Contribuidores
+ name: Nombre
+ commits_count: Commits propinadas
+ withdrawn: Retirado
+ show:
+ balance: Balance
+ threshold: "Podr s retirar su dinero cuando su balance llegue al umbral de %{threshold}."
+ see_all: Ver todos
+ received: "%{time} recibi¢ %{amount} por el commit %{commit} en %{project} "
+ bitcoin_address_placeholder: Su direcci¢n de Bitcoin
+ notify: Notif¡came sobre nuevas propinas (no m s de un email por mes)
+ submit_user: Cambiar informaci¢n de usuario
+ change_password: Cambie su contrase¤a
+ submit_password: Actualizar contrase¤a
+ use_from_gravatar: Use el de su cuenta de gravatar
+ withdrawals:
+ index:
+ title: Retiros recientes
+ created_at: Creado en
+ transaction: Transacci¢n
+ result: Resultado
+ error: Error
+ success: Exitoso
+ devise:
+ sessions:
+ new:
+ title: Iniciar Sesi¢n
+ remember_me: Recu‚rdame
+ submit: Iniciar Sesi¢n
+ registrations:
+ new:
+ title: Registraci¢n
+ submit: Registrar
+ passwords:
+ new:
+ title: ¨Olvido su contrase¤a?
+ submit: M ndame instrucciones para resetear mi contrase¤a
+ edit:
+ title: Cambie su contrase¤a
+ submit: Actualizar contrase¤a
+ confirmations:
+ new:
+ title: M ndeme de nuevo instrucciones de confirmaci¢n
+ submit: M ndeme de nuevo instrucciones de confirmaci¢n
+ links:
+ sign_in: Iniciar Sesi¢n
+ sign_up: Registrar
+ recover: ¨Olvido su contrase¤a?
+ confirm: ¨No recibi¢ instrucciones de confirmaci¢n?
+ sign_in_with: "Iniciar sesi¢n con %{provider} "
+ errors:
+ primary_email: Su correo electr¢nico primario debe ser verificado.
+ onmiauth_info: No pudimos obtener tu informaci¢n.
+ activerecord:
+ attributes:
+ user:
+ email: Correo Electr¢nico
+ bitcoin_address: Direcci¢n de Bitcoin
+ password: Contrase¤a
+ password_confirmation: Contrase¤a de confirmaci¢n
+ display_name: Nombre publico
+ omniauth_providers:
+ github: GitHub
+ bitbucket: BitBucket
+ general:
+ or: O
+ disclaimer:
+ line1: "Tip4Commit no est asociado con la mayor¡a de los proyectos."
+ line2: "No hay ninguna garant¡a que las propinas sean reclamadas por los desarrolladores."
+ line3: "Al donar fondos, usted esta de acuerdo que los fondos podr n ser enviados a la fundaci¢n de software gratuito (Free Software Foundation) o a otra parte a nuestra discreci¢n."
From 117e67e89b075e83e0bcec8c8b8bdb5acaaee99a Mon Sep 17 00:00:00 2001
From: Merco
Date: Wed, 6 Dec 2017 23:42:07 -0800
Subject: [PATCH 006/159] Removed es.txt
Obviously, it has an incorrect name. But most importantly, the file was uploaded with incorrect encoding (`windows-1252`). This ended up breaking all the accents, `n`s with tildes and the upside down question marks. Will re-upload with appropriate encoding and correct name file.
---
config/locales/es.txt | 233 ------------------------------------------
1 file changed, 233 deletions(-)
delete mode 100644 config/locales/es.txt
diff --git a/config/locales/es.txt b/config/locales/es.txt
deleted file mode 100644
index f3599582..00000000
--- a/config/locales/es.txt
+++ /dev/null
@@ -1,233 +0,0 @@
-es:
- tip4commit: Tip4Commit
- meta:
- title: Contribuye a c¢digo abierto
- description: Dona Bitcoins a proyectos de c¢digo abierto o haz commits y recibe propinas por ellos.
- menu:
- home: Inicio
- projects: Proyectos soportados
- footer:
- text: "El c¢digo fuente est disponible en %{github_link} y tambi‚n puedes %{support_link} su desarollo."
- github_link: GitHub
- support_link: apoyar
- follow_link: S¡guenos en @tip4commit
- links:
- sign_up: registrar
- sign_in: inicia sesi¢n
- sign_in_imp: inicie sesi¢n
- sign_out: Cerrar Sesi¢n
- create_issue: crea un problema
- errors:
- project_not_found: El proyecto no fue encontrado.
- opt_in_notice: "Debido a varias quejas de mantenedores de proyectos, no agregamos proyectos autom ticamente. Proyectos existentes sin dep¢sitos han sido removidos. Si usted quiere agregar su proyecto, por favor %{create_issue_link}.
- access_denied: Acceso rechazado
- can_assign_more_tips: "No puede asignar m s de 100% de los fondos disponibles."
- wrong_bitcoin_address: Ocurri¢ un error al actualizar su direcci¢n de bitcoin
- user_not_found: No se pudo encontrar el usuario
- access_denied: Usted no est autorizado para realizar esa acci¢n!
- notices:
- project_updated: Las configuraciones de su proyecto fueron actualizadas.
- tips_decided: La cantidad de propina ha sido definida.
- user_updated: La informaci¢n ha sido actualizada.
- user_unsubscribed: "Usted ya no recibir notificaciones de nosotros. Nos disculpamos por haberte molestado. Pero a£n puede dejar su direcci¢n de bitcoin para recibir sus propinas."
- tip_amounts:
- undecided: "Indeciso"
- free: "Gratis: 0%"
- tiny: "Diminuto: 0.1%"
- small: "Peque¤o: 0.5%"
- normal: "Normal: 1%"
- big: "Grande: 2%"
- huge: "Enorme: 5%"
- js:
- errors:
- value:
- invalid: Valor no v lido.
- email:
- invalid: Correo electr¢nico no v lido.
- blank: El correo electr¢nico es requerido y no puede dejarlo en blanco.
- password:
- blank: La contrase¤a es requerida y no puede dejarlo en blanco.
- invalid: Su contrase¤a no es igual a la contrase¤a de confirmaci¢n.
- password_confirmation:
- blank: La contrase¤a de confirmaci¢n es requerida y no puede dejarlo en blanco.
- invalid: Su contrase¤a no es igual a la contrase¤a de confirmaci¢n.
- home:
- index:
- see_projects: Ver proyectos
- how_does_it_work:
- title: ¨Como funciona?
- text: La gente dona bitcoin a proyectos. Cuando el commit de alguien es agregada al proyecto, nosotros autom ticamente le damos una propina al autor.
- button: Aprende m s sobre Bitcoin
- donate:
- title: Haz donaciones
- text: Encuentra un proyecto que te guste y d¢nale bitcoins. Su donaci¢n ser acumulada con los fondos de otros donadores para poder darse como propinas para nuevos commits.
- button: Busca o agrega un proyecto
- contribute:
- title: Contribuye
- text: Ve y arregla algo. Si tu commit es aceptado por el mantenedor del proyecto, recibir s una propina!
- sign_in_text: "Solo cheque su bandeja por una invitaci¢n o %{sign_in_link}."
- sign_up_text: "Si usted a£n no ha recibido una invitaci¢n, se puede %{sign_up_link} con un correo electr¢nico valido."
- button: Proyectos soportados
- projects:
- index:
- find_project:
- placeholder: Enlace hacia un proyecto de GitHub o busque
- button: Busca proyecto
- repository: Repositorio
- description: Descripci¢n
- watchers: Seguidores
- balance: Balance
- forked_from: copiado de
- support: Soporta este proyecto
- show:
- title: "Contribuye a %{project} "
- fetch_pending: (Obtenci¢n inicial pendiente)
- edit_project: Cambiar ajustes del proyecto
- decide_tip_amounts: Decide cantidad de propina
- disabled_notifications: "Mantenedores de proyectos han decidido no notificarles a nuevos contribuidores sobre las propinas y probablemente no les guste esta manera de financiamiento."
- fee: "%{percentage} de los fondos ser n usados como propinas para nuevos commits."
- balance: Balance
- deposits: depositos
- custom_tip_size: (cada nuevo commit recibe un porcentaje del balance disponible)
- default_tip_size: "(cada nuevo commit recibe %{percentage} del balance disponible)"
- min_tip_size: "La propina m¡nima es de %{min_tip}, pero si el balance disponible es menor de la propina m¡nima, una propina m s peque¤a ser enviada"
- unconfirmed_amount: "(%{amount} no confirmado)"
- tipping_policies: Pol¡tica de propina
- updated_by_user: "(Ultimo cambio por %{name} el %{date})"
- updated_by_unknown: "(Ultimo cambio el %{date})"
- tips_paid: Propinas pagadas
- unclaimed_amount: "(%{amount} no han sido reclamado, y ser devuelto al proyecto despu‚s de un mes sin reclamacion.)"
- last_tips: Ultimas propinas
- see_all: Ver todas
- received: "%{amount} recibi¢"
- will_receive: recibir una propina de
- for_commit: por el commit
- when_decided: cuando la cantidad sea decidida
- next_tip: Siguiente Propina
- contribute_and_earn: Contribuye y Gana
- contribute_and_earn_description: "Dona Bitcoins a este proyecto o %{make_commits_link} y recibe propinas por ellos. Si tu commit es aceptado %{branch} por un mantenedor de proyecto y hay Bitcoins disponibles, recibir s una propina!"
- contribute_and_earn_branch: "al %{branch} branch"
- make_commits_link: haz commits
- tell_us_bitcoin_address: Solo %{tell_us_link} su direcci¢n de Bitcoin.
- tell_us_link: d¡ganos
- sign_in: "Solo cheque su bandeja o %{sign_in_link}."
- promote_project: Promueve %{project}
- embedding: Integraciones
- image_url: "Enlace de Imagen:"
- shield_title: propina para siguiente commit
- edit:
- project_settings: "Ajustes del proyecto %{project} "
- branch: Branch
- default_branch: Branch predeterminado
- tipping_policies: Pol¡tica de propina
- hold_tips: "No envi‚ las propinas inmediatamente. Dele a los colaboradores la habilidad de modificar las propinas antes que sean enviadas"
- save: Actualizar ajustes del proyecto
- disable_notifications: No notifique a nuevos contribuidores
- decide_tip_amounts:
- commit: Commit
- author: Autor
- message: Mensaje
- tip: Propina (relativo al balance del proyecto)
- submit: Envia las propinas seleccionadas
- blacklisted:
- title: Lo sentimos mucho, pero esto proyecto no acepta propinas.
- message: El autor de este proyecto ha deshabilitado propinas para este proyecto.
- tips:
- index:
- tips: Consejos
- project_tips: 'Consejos de %{project}'
- user_tips: "Consejos de %{user}"
- created_at: Creado en
- commiter: Commiter
- project: Proyecto
- commit: Commit
- amount: Cantidad
- refunded: Reembolsado al dep¢sito del proyecto
- undecided: La cantidad de la propina a£n no se ha decidido
- no_bitcoin_address: El usuario no especifico una direcci¢n de deposito
- below_threshold: "El saldo del usuario no ha superado el umbral de retiro "
- waiting: Esperando por el retiro
- error: (error al procesar la transacci¢n)
- deposits:
- index:
- project_deposits: 'Dep¢sitos de %{project}'
- deposits: Dep¢sitos
- created_at: Creado en
- project: Proyecto
- amount: Cantidad
- transaction: Transacci¢n
- confirmed: Confirmado
- confirmed_yes: 'Si'
- confirmed_no: 'No'
- users:
- index:
- title: Mayores Contribuidores
- name: Nombre
- commits_count: Commits propinadas
- withdrawn: Retirado
- show:
- balance: Balance
- threshold: "Podr s retirar su dinero cuando su balance llegue al umbral de %{threshold}."
- see_all: Ver todos
- received: "%{time} recibi¢ %{amount} por el commit %{commit} en %{project} "
- bitcoin_address_placeholder: Su direcci¢n de Bitcoin
- notify: Notif¡came sobre nuevas propinas (no m s de un email por mes)
- submit_user: Cambiar informaci¢n de usuario
- change_password: Cambie su contrase¤a
- submit_password: Actualizar contrase¤a
- use_from_gravatar: Use el de su cuenta de gravatar
- withdrawals:
- index:
- title: Retiros recientes
- created_at: Creado en
- transaction: Transacci¢n
- result: Resultado
- error: Error
- success: Exitoso
- devise:
- sessions:
- new:
- title: Iniciar Sesi¢n
- remember_me: Recu‚rdame
- submit: Iniciar Sesi¢n
- registrations:
- new:
- title: Registraci¢n
- submit: Registrar
- passwords:
- new:
- title: ¨Olvido su contrase¤a?
- submit: M ndame instrucciones para resetear mi contrase¤a
- edit:
- title: Cambie su contrase¤a
- submit: Actualizar contrase¤a
- confirmations:
- new:
- title: M ndeme de nuevo instrucciones de confirmaci¢n
- submit: M ndeme de nuevo instrucciones de confirmaci¢n
- links:
- sign_in: Iniciar Sesi¢n
- sign_up: Registrar
- recover: ¨Olvido su contrase¤a?
- confirm: ¨No recibi¢ instrucciones de confirmaci¢n?
- sign_in_with: "Iniciar sesi¢n con %{provider} "
- errors:
- primary_email: Su correo electr¢nico primario debe ser verificado.
- onmiauth_info: No pudimos obtener tu informaci¢n.
- activerecord:
- attributes:
- user:
- email: Correo Electr¢nico
- bitcoin_address: Direcci¢n de Bitcoin
- password: Contrase¤a
- password_confirmation: Contrase¤a de confirmaci¢n
- display_name: Nombre publico
- omniauth_providers:
- github: GitHub
- bitbucket: BitBucket
- general:
- or: O
- disclaimer:
- line1: "Tip4Commit no est asociado con la mayor¡a de los proyectos."
- line2: "No hay ninguna garant¡a que las propinas sean reclamadas por los desarrolladores."
- line3: "Al donar fondos, usted esta de acuerdo que los fondos podr n ser enviados a la fundaci¢n de software gratuito (Free Software Foundation) o a otra parte a nuestra discreci¢n."
From c398e77ad067faeaaeed8d3b7d49ec963d2857ee Mon Sep 17 00:00:00 2001
From: Merco
Date: Wed, 6 Dec 2017 23:44:22 -0800
Subject: [PATCH 007/159] Spanish language re-upload
Re-uploaded the Spanish translation with appropriate encoding.
---
config/locales/es.yml | 233 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 233 insertions(+)
create mode 100644 config/locales/es.yml
diff --git a/config/locales/es.yml b/config/locales/es.yml
new file mode 100644
index 00000000..4c17bd66
--- /dev/null
+++ b/config/locales/es.yml
@@ -0,0 +1,233 @@
+es:
+ tip4commit: Tip4Commit
+ meta:
+ title: Contribuye a cdigo abierto
+ description: Dona Bitcoins a proyectos de código abierto o haz commits y recibe propinas por ellos.
+ menu:
+ home: Inicio
+ projects: Proyectos soportados
+ footer:
+ text: "El código fuente está disponible en %{github_link} y también puedes %{support_link} su desarollo."
+ github_link: GitHub
+ support_link: apoyar
+ follow_link: S¡guenos en @tip4commit
+ links:
+ sign_up: registrar
+ sign_in: inicia sesión
+ sign_in_imp: inicie sesión
+ sign_out: Cerrar Sesión
+ create_issue: crea un problema
+ errors:
+ project_not_found: El proyecto no fue encontrado.
+ opt_in_notice: "Debido a varias quejas de mantenedores de proyectos, no agregamos proyectos automáticamente. Proyectos existentes sin depósitos han sido removidos. Si usted quiere agregar su proyecto, por favor %{create_issue_link}.
+ access_denied: Acceso rechazado
+ can_assign_more_tips: "No puede asignar más de 100% de los fondos disponibles."
+ wrong_bitcoin_address: Ocurrió un error al actualizar su dirección de bitcoin
+ user_not_found: No se pudo encontrar el usuario
+ access_denied: Usted no está autorizado para realizar esa acción!
+ notices:
+ project_updated: Las configuraciones de su proyecto fueron actualizadas.
+ tips_decided: La cantidad de propina ha sido definida.
+ user_updated: La información ha sido actualizada.
+ user_unsubscribed: "Usted ya no recibirá notificaciones de nosotros. Nos disculpamos por haberte molestado. Pero a£n puede dejar su dirección de bitcoin para recibir sus propinas."
+ tip_amounts:
+ undecided: "Indeciso"
+ free: "Gratis: 0%"
+ tiny: "Diminuto: 0.1%"
+ small: "Pequeño: 0.5%"
+ normal: "Normal: 1%"
+ big: "Grande: 2%"
+ huge: "Enorme: 5%"
+ js:
+ errors:
+ value:
+ invalid: Valor no válido.
+ email:
+ invalid: Correo electrónico no válido.
+ blank: El correo electrónico es requerido y no puede dejarlo en blanco.
+ password:
+ blank: La contraseña es requerida y no puede dejarlo en blanco.
+ invalid: Su contraseña no es igual a la contraseña de confirmación.
+ password_confirmation:
+ blank: La contraseña de confirmación es requerida y no puede dejarlo en blanco.
+ invalid: Su contraseña no es igual a la contraseña de confirmación.
+ home:
+ index:
+ see_projects: Ver proyectos
+ how_does_it_work:
+ title: ¿Como funciona?
+ text: La gente dona bitcoin a proyectos. Cuando el commit de alguien es agregada al proyecto, nosotros automáticamente le damos una propina al autor.
+ button: Aprende más sobre Bitcoin
+ donate:
+ title: Haz donaciones
+ text: Encuentra un proyecto que te guste y dónale bitcoins. Su donación será acumulada con los fondos de otros donadores para poder darse como propinas para nuevos commits.
+ button: Busca o agrega un proyecto
+ contribute:
+ title: Contribuye
+ text: Ve y arregla algo. Si tu commit es aceptado por el mantenedor del proyecto, recibirás una propina!
+ sign_in_text: "Solo cheque su bandeja por una invitación o %{sign_in_link}."
+ sign_up_text: "Si usted a£n no ha recibido una invitación, se puede %{sign_up_link} con un correo electrónico valido."
+ button: Proyectos soportados
+ projects:
+ index:
+ find_project:
+ placeholder: Enlace hacia un proyecto de GitHub o busque
+ button: Busca proyecto
+ repository: Repositorio
+ description: Descripción
+ watchers: Seguidores
+ balance: Balance
+ forked_from: copiado de
+ support: Soporta este proyecto
+ show:
+ title: "Contribuye a %{project} "
+ fetch_pending: (Obtención inicial pendiente)
+ edit_project: Cambiar ajustes del proyecto
+ decide_tip_amounts: Decide cantidad de propina
+ disabled_notifications: "Mantenedores de proyectos han decidido no notificarles a nuevos contribuidores sobre las propinas y probablemente no les guste esta manera de financiamiento."
+ fee: "%{percentage} de los fondos serán usados como propinas para nuevos commits."
+ balance: Balance
+ deposits: depositos
+ custom_tip_size: (cada nuevo commit recibe un porcentaje del balance disponible)
+ default_tip_size: "(cada nuevo commit recibe %{percentage} del balance disponible)"
+ min_tip_size: "La propina m¡nima es de %{min_tip}, pero si el balance disponible es menor de la propina m¡nima, una propina más pequeña será enviada"
+ unconfirmed_amount: "(%{amount} no confirmado)"
+ tipping_policies: Pol¡tica de propina
+ updated_by_user: "(Ultimo cambio por %{name} el %{date})"
+ updated_by_unknown: "(Ultimo cambio el %{date})"
+ tips_paid: Propinas pagadas
+ unclaimed_amount: "(%{amount} no han sido reclamado, y será devuelto al proyecto después de un mes sin reclamacion.)"
+ last_tips: Ultimas propinas
+ see_all: Ver todas
+ received: "%{amount} recibió"
+ will_receive: recibirá una propina de
+ for_commit: por el commit
+ when_decided: cuando la cantidad sea decidida
+ next_tip: Siguiente Propina
+ contribute_and_earn: Contribuye y Gana
+ contribute_and_earn_description: "Dona Bitcoins a este proyecto o %{make_commits_link} y recibe propinas por ellos. Si tu commit es aceptado %{branch} por un mantenedor de proyecto y hay Bitcoins disponibles, recibirás una propina!"
+ contribute_and_earn_branch: "al %{branch} branch"
+ make_commits_link: haz commits
+ tell_us_bitcoin_address: Solo %{tell_us_link} su dirección de Bitcoin.
+ tell_us_link: d¡ganos
+ sign_in: "Solo cheque su bandeja o %{sign_in_link}."
+ promote_project: Promueve %{project}
+ embedding: Integraciones
+ image_url: "Enlace de Imagen:"
+ shield_title: propina para siguiente commit
+ edit:
+ project_settings: "Ajustes del proyecto %{project} "
+ branch: Branch
+ default_branch: Branch predeterminado
+ tipping_policies: Pol¡tica de propina
+ hold_tips: "No envié las propinas inmediatamente. Dele a los colaboradores la habilidad de modificar las propinas antes que sean enviadas"
+ save: Actualizar ajustes del proyecto
+ disable_notifications: No notifique a nuevos contribuidores
+ decide_tip_amounts:
+ commit: Commit
+ author: Autor
+ message: Mensaje
+ tip: Propina (relativo al balance del proyecto)
+ submit: Envia las propinas seleccionadas
+ blacklisted:
+ title: Lo sentimos mucho, pero esto proyecto no acepta propinas.
+ message: El autor de este proyecto ha deshabilitado propinas para este proyecto.
+ tips:
+ index:
+ tips: Consejos
+ project_tips: 'Consejos de %{project}'
+ user_tips: "Consejos de %{user}"
+ created_at: Creado en
+ commiter: Commiter
+ project: Proyecto
+ commit: Commit
+ amount: Cantidad
+ refunded: Reembolsado al depósito del proyecto
+ undecided: La cantidad de la propina a£n no se ha decidido
+ no_bitcoin_address: El usuario no especifico una dirección de deposito
+ below_threshold: "El saldo del usuario no ha superado el umbral de retiro "
+ waiting: Esperando por el retiro
+ error: (error al procesar la transacción)
+ deposits:
+ index:
+ project_deposits: 'Depósitos de %{project}'
+ deposits: Depósitos
+ created_at: Creado en
+ project: Proyecto
+ amount: Cantidad
+ transaction: Transacción
+ confirmed: Confirmado
+ confirmed_yes: 'Si'
+ confirmed_no: 'No'
+ users:
+ index:
+ title: Mayores Contribuidores
+ name: Nombre
+ commits_count: Commits propinadas
+ withdrawn: Retirado
+ show:
+ balance: Balance
+ threshold: "Podrás retirar su dinero cuando su balance llegue al umbral de %{threshold}."
+ see_all: Ver todos
+ received: "%{time} recibió %{amount} por el commit %{commit} en %{project} "
+ bitcoin_address_placeholder: Su dirección de Bitcoin
+ notify: Notif¡came sobre nuevas propinas (no más de un email por mes)
+ submit_user: Cambiar información de usuario
+ change_password: Cambie su contraseña
+ submit_password: Actualizar contraseña
+ use_from_gravatar: Use el de su cuenta de gravatar
+ withdrawals:
+ index:
+ title: Retiros recientes
+ created_at: Creado en
+ transaction: Transacción
+ result: Resultado
+ error: Error
+ success: Exitoso
+ devise:
+ sessions:
+ new:
+ title: Iniciar Sesión
+ remember_me: Recuérdame
+ submit: Iniciar Sesión
+ registrations:
+ new:
+ title: Registración
+ submit: Registrar
+ passwords:
+ new:
+ title: ¿Olvido su contraseña?
+ submit: Mándame instrucciones para resetear mi contraseña
+ edit:
+ title: Cambie su contraseña
+ submit: Actualizar contraseña
+ confirmations:
+ new:
+ title: Mándeme de nuevo instrucciones de confirmación
+ submit: Mándeme de nuevo instrucciones de confirmación
+ links:
+ sign_in: Iniciar Sesión
+ sign_up: Registrar
+ recover: ¿Olvido su contraseña?
+ confirm: ¿No recibió instrucciones de confirmación?
+ sign_in_with: "Iniciar sesión con %{provider} "
+ errors:
+ primary_email: Su correo electrónico primario debe ser verificado.
+ onmiauth_info: No pudimos obtener tu información.
+ activerecord:
+ attributes:
+ user:
+ email: Correo Electrónico
+ bitcoin_address: Dirección de Bitcoin
+ password: Contraseña
+ password_confirmation: Contraseña de confirmación
+ display_name: Nombre publico
+ omniauth_providers:
+ github: GitHub
+ bitbucket: BitBucket
+ general:
+ or: O
+ disclaimer:
+ line1: "Tip4Commit no está asociado con la mayor¡a de los proyectos."
+ line2: "No hay ninguna garant¡a que las propinas sean reclamadas por los desarrolladores."
+ line3: "Al donar fondos, usted esta de acuerdo que los fondos podrán ser enviados a la fundación de software gratuito (Free Software Foundation) o a otra parte a nuestra discreción."
From 26dad87c1994e34bd8f5cce4e21025138d5e7a1f Mon Sep 17 00:00:00 2001
From: Merco
Date: Wed, 6 Dec 2017 23:45:58 -0800
Subject: [PATCH 008/159] Missed an o
An `o` was missing. Fixed that.
---
config/locales/es.yml | 158 +++++++++++++++++++++---------------------
1 file changed, 79 insertions(+), 79 deletions(-)
diff --git a/config/locales/es.yml b/config/locales/es.yml
index 4c17bd66..bbc1a1c6 100644
--- a/config/locales/es.yml
+++ b/config/locales/es.yml
@@ -1,72 +1,72 @@
es:
tip4commit: Tip4Commit
meta:
- title: Contribuye a cdigo abierto
- description: Dona Bitcoins a proyectos de código abierto o haz commits y recibe propinas por ellos.
+ title: Contribuye a código abierto
+ description: Dona Bitcoins a proyectos de código abierto o haz commits y recibe propinas por ellos.
menu:
home: Inicio
projects: Proyectos soportados
footer:
- text: "El código fuente está disponible en %{github_link} y también puedes %{support_link} su desarollo."
+ text: "El código fuente está disponible en %{github_link} y también puedes %{support_link} su desarollo."
github_link: GitHub
support_link: apoyar
- follow_link: S¡guenos en @tip4commit
+ follow_link: S¡guenos en @tip4commit
links:
sign_up: registrar
- sign_in: inicia sesión
- sign_in_imp: inicie sesión
- sign_out: Cerrar Sesión
+ sign_in: inicia sesión
+ sign_in_imp: inicie sesión
+ sign_out: Cerrar Sesión
create_issue: crea un problema
errors:
project_not_found: El proyecto no fue encontrado.
- opt_in_notice: "Debido a varias quejas de mantenedores de proyectos, no agregamos proyectos automáticamente. Proyectos existentes sin depósitos han sido removidos. Si usted quiere agregar su proyecto, por favor %{create_issue_link}.
+ opt_in_notice: "Debido a varias quejas de mantenedores de proyectos, no agregamos proyectos automáticamente. Proyectos existentes sin depósitos han sido removidos. Si usted quiere agregar su proyecto, por favor %{create_issue_link}.
access_denied: Acceso rechazado
- can_assign_more_tips: "No puede asignar más de 100% de los fondos disponibles."
- wrong_bitcoin_address: Ocurrió un error al actualizar su dirección de bitcoin
+ can_assign_more_tips: "No puede asignar más de 100% de los fondos disponibles."
+ wrong_bitcoin_address: Ocurrió un error al actualizar su dirección de bitcoin
user_not_found: No se pudo encontrar el usuario
- access_denied: Usted no está autorizado para realizar esa acción!
+ access_denied: ÂUsted no está autorizado para realizar esa acción!
notices:
project_updated: Las configuraciones de su proyecto fueron actualizadas.
tips_decided: La cantidad de propina ha sido definida.
- user_updated: La información ha sido actualizada.
- user_unsubscribed: "Usted ya no recibirá notificaciones de nosotros. Nos disculpamos por haberte molestado. Pero a£n puede dejar su dirección de bitcoin para recibir sus propinas."
+ user_updated: La información ha sido actualizada.
+ user_unsubscribed: "Usted ya no recibirá notificaciones de nosotros. Nos disculpamos por haberte molestado. Pero a£n puede dejar su dirección de bitcoin para recibir sus propinas."
tip_amounts:
undecided: "Indeciso"
free: "Gratis: 0%"
tiny: "Diminuto: 0.1%"
- small: "Pequeño: 0.5%"
+ small: "Pequeño: 0.5%"
normal: "Normal: 1%"
big: "Grande: 2%"
huge: "Enorme: 5%"
js:
errors:
value:
- invalid: Valor no válido.
+ invalid: Valor no válido.
email:
- invalid: Correo electrónico no válido.
- blank: El correo electrónico es requerido y no puede dejarlo en blanco.
+ invalid: Correo electrónico no válido.
+ blank: El correo electrónico es requerido y no puede dejarlo en blanco.
password:
- blank: La contraseña es requerida y no puede dejarlo en blanco.
- invalid: Su contraseña no es igual a la contraseña de confirmación.
+ blank: La contraseña es requerida y no puede dejarlo en blanco.
+ invalid: Su contraseña no es igual a la contraseña de confirmación.
password_confirmation:
- blank: La contraseña de confirmación es requerida y no puede dejarlo en blanco.
- invalid: Su contraseña no es igual a la contraseña de confirmación.
+ blank: La contraseña de confirmación es requerida y no puede dejarlo en blanco.
+ invalid: Su contraseña no es igual a la contraseña de confirmación.
home:
index:
see_projects: Ver proyectos
how_does_it_work:
- title: ¿Como funciona?
- text: La gente dona bitcoin a proyectos. Cuando el commit de alguien es agregada al proyecto, nosotros automáticamente le damos una propina al autor.
- button: Aprende más sobre Bitcoin
+ title: ¿Como funciona?
+ text: La gente dona bitcoin a proyectos. Cuando el commit de alguien es agregada al proyecto, nosotros automáticamente le damos una propina al autor.
+ button: Aprende más sobre Bitcoin
donate:
title: Haz donaciones
- text: Encuentra un proyecto que te guste y dónale bitcoins. Su donación será acumulada con los fondos de otros donadores para poder darse como propinas para nuevos commits.
+ text: Encuentra un proyecto que te guste y dónale bitcoins. Su donación será acumulada con los fondos de otros donadores para poder darse como propinas para nuevos commits.
button: Busca o agrega un proyecto
contribute:
title: Contribuye
- text: Ve y arregla algo. Si tu commit es aceptado por el mantenedor del proyecto, recibirás una propina!
- sign_in_text: "Solo cheque su bandeja por una invitación o %{sign_in_link}."
- sign_up_text: "Si usted a£n no ha recibido una invitación, se puede %{sign_up_link} con un correo electrónico valido."
+ text: Ve y arregla algo. Si tu commit es aceptado por el mantenedor del proyecto, Ârecibirás una propina!
+ sign_in_text: "Solo cheque su bandeja por una invitación o %{sign_in_link}."
+ sign_up_text: "Si usted a£n no ha recibido una invitación, se puede %{sign_up_link} con un correo electrónico valido."
button: Proyectos soportados
projects:
index:
@@ -74,42 +74,42 @@ es:
placeholder: Enlace hacia un proyecto de GitHub o busque
button: Busca proyecto
repository: Repositorio
- description: Descripción
+ description: Descripción
watchers: Seguidores
balance: Balance
forked_from: copiado de
support: Soporta este proyecto
show:
title: "Contribuye a %{project} "
- fetch_pending: (Obtención inicial pendiente)
+ fetch_pending: (Obtención inicial pendiente)
edit_project: Cambiar ajustes del proyecto
decide_tip_amounts: Decide cantidad de propina
disabled_notifications: "Mantenedores de proyectos han decidido no notificarles a nuevos contribuidores sobre las propinas y probablemente no les guste esta manera de financiamiento."
- fee: "%{percentage} de los fondos serán usados como propinas para nuevos commits."
+ fee: "%{percentage} de los fondos serán usados como propinas para nuevos commits."
balance: Balance
deposits: depositos
custom_tip_size: (cada nuevo commit recibe un porcentaje del balance disponible)
default_tip_size: "(cada nuevo commit recibe %{percentage} del balance disponible)"
- min_tip_size: "La propina m¡nima es de %{min_tip}, pero si el balance disponible es menor de la propina m¡nima, una propina más pequeña será enviada"
+ min_tip_size: "La propina m¡nima es de %{min_tip}, pero si el balance disponible es menor de la propina m¡nima, una propina más pequeña será enviada"
unconfirmed_amount: "(%{amount} no confirmado)"
- tipping_policies: Pol¡tica de propina
+ tipping_policies: Pol¡tica de propina
updated_by_user: "(Ultimo cambio por %{name} el %{date})"
updated_by_unknown: "(Ultimo cambio el %{date})"
tips_paid: Propinas pagadas
- unclaimed_amount: "(%{amount} no han sido reclamado, y será devuelto al proyecto después de un mes sin reclamacion.)"
+ unclaimed_amount: "(%{amount} no han sido reclamado, y será devuelto al proyecto después de un mes sin reclamacion.)"
last_tips: Ultimas propinas
see_all: Ver todas
- received: "%{amount} recibió"
- will_receive: recibirá una propina de
+ received: "%{amount} recibió"
+ will_receive: recibirá una propina de
for_commit: por el commit
when_decided: cuando la cantidad sea decidida
next_tip: Siguiente Propina
contribute_and_earn: Contribuye y Gana
- contribute_and_earn_description: "Dona Bitcoins a este proyecto o %{make_commits_link} y recibe propinas por ellos. Si tu commit es aceptado %{branch} por un mantenedor de proyecto y hay Bitcoins disponibles, recibirás una propina!"
+ contribute_and_earn_description: "Dona Bitcoins a este proyecto o %{make_commits_link} y recibe propinas por ellos. Si tu commit es aceptado %{branch} por un mantenedor de proyecto y hay Bitcoins disponibles, Ârecibirás una propina!"
contribute_and_earn_branch: "al %{branch} branch"
make_commits_link: haz commits
- tell_us_bitcoin_address: Solo %{tell_us_link} su dirección de Bitcoin.
- tell_us_link: d¡ganos
+ tell_us_bitcoin_address: Solo %{tell_us_link} su dirección de Bitcoin.
+ tell_us_link: d¡ganos
sign_in: "Solo cheque su bandeja o %{sign_in_link}."
promote_project: Promueve %{project}
embedding: Integraciones
@@ -119,8 +119,8 @@ es:
project_settings: "Ajustes del proyecto %{project} "
branch: Branch
default_branch: Branch predeterminado
- tipping_policies: Pol¡tica de propina
- hold_tips: "No envié las propinas inmediatamente. Dele a los colaboradores la habilidad de modificar las propinas antes que sean enviadas"
+ tipping_policies: Pol¡tica de propina
+ hold_tips: "No envié las propinas inmediatamente. Dele a los colaboradores la habilidad de modificar las propinas antes que sean enviadas"
save: Actualizar ajustes del proyecto
disable_notifications: No notifique a nuevos contribuidores
decide_tip_amounts:
@@ -142,20 +142,20 @@ es:
project: Proyecto
commit: Commit
amount: Cantidad
- refunded: Reembolsado al depósito del proyecto
- undecided: La cantidad de la propina a£n no se ha decidido
- no_bitcoin_address: El usuario no especifico una dirección de deposito
+ refunded: Reembolsado al depósito del proyecto
+ undecided: La cantidad de la propina a£n no se ha decidido
+ no_bitcoin_address: El usuario no especifico una dirección de deposito
below_threshold: "El saldo del usuario no ha superado el umbral de retiro "
waiting: Esperando por el retiro
- error: (error al procesar la transacción)
+ error: (error al procesar la transacción)
deposits:
index:
- project_deposits: 'Depósitos de %{project}'
- deposits: Depósitos
+ project_deposits: 'Depósitos de %{project}'
+ deposits: Depósitos
created_at: Creado en
project: Proyecto
amount: Cantidad
- transaction: Transacción
+ transaction: Transacción
confirmed: Confirmado
confirmed_yes: 'Si'
confirmed_no: 'No'
@@ -167,60 +167,60 @@ es:
withdrawn: Retirado
show:
balance: Balance
- threshold: "Podrás retirar su dinero cuando su balance llegue al umbral de %{threshold}."
+ threshold: "Podrás retirar su dinero cuando su balance llegue al umbral de %{threshold}."
see_all: Ver todos
- received: "%{time} recibió %{amount} por el commit %{commit} en %{project} "
- bitcoin_address_placeholder: Su dirección de Bitcoin
- notify: Notif¡came sobre nuevas propinas (no más de un email por mes)
- submit_user: Cambiar información de usuario
- change_password: Cambie su contraseña
- submit_password: Actualizar contraseña
+ received: "%{time} recibió %{amount} por el commit %{commit} en %{project} "
+ bitcoin_address_placeholder: Su dirección de Bitcoin
+ notify: Notif¡came sobre nuevas propinas (no más de un email por mes)
+ submit_user: Cambiar información de usuario
+ change_password: Cambie su contraseña
+ submit_password: Actualizar contraseña
use_from_gravatar: Use el de su cuenta de gravatar
withdrawals:
index:
title: Retiros recientes
created_at: Creado en
- transaction: Transacción
+ transaction: Transacción
result: Resultado
error: Error
success: Exitoso
devise:
sessions:
new:
- title: Iniciar Sesión
- remember_me: Recuérdame
- submit: Iniciar Sesión
+ title: Iniciar Sesión
+ remember_me: Recuérdame
+ submit: Iniciar Sesión
registrations:
new:
- title: Registración
+ title: Registración
submit: Registrar
passwords:
new:
- title: ¿Olvido su contraseña?
- submit: Mándame instrucciones para resetear mi contraseña
+ title: ¿Olvido su contraseña?
+ submit: Mándame instrucciones para resetear mi contraseña
edit:
- title: Cambie su contraseña
- submit: Actualizar contraseña
+ title: Cambie su contraseña
+ submit: Actualizar contraseña
confirmations:
new:
- title: Mándeme de nuevo instrucciones de confirmación
- submit: Mándeme de nuevo instrucciones de confirmación
+ title: Mándeme de nuevo instrucciones de confirmación
+ submit: Mándeme de nuevo instrucciones de confirmación
links:
- sign_in: Iniciar Sesión
+ sign_in: Iniciar Sesión
sign_up: Registrar
- recover: ¿Olvido su contraseña?
- confirm: ¿No recibió instrucciones de confirmación?
- sign_in_with: "Iniciar sesión con %{provider} "
+ recover: ¿Olvido su contraseña?
+ confirm: ¿No recibió instrucciones de confirmación?
+ sign_in_with: "Iniciar sesión con %{provider} "
errors:
- primary_email: Su correo electrónico primario debe ser verificado.
- onmiauth_info: No pudimos obtener tu información.
+ primary_email: Su correo electrónico primario debe ser verificado.
+ onmiauth_info: No pudimos obtener tu información.
activerecord:
attributes:
user:
- email: Correo Electrónico
- bitcoin_address: Dirección de Bitcoin
- password: Contraseña
- password_confirmation: Contraseña de confirmación
+ email: Correo Electrónico
+ bitcoin_address: Dirección de Bitcoin
+ password: Contraseña
+ password_confirmation: Contraseña de confirmación
display_name: Nombre publico
omniauth_providers:
github: GitHub
@@ -228,6 +228,6 @@ es:
general:
or: O
disclaimer:
- line1: "Tip4Commit no está asociado con la mayor¡a de los proyectos."
- line2: "No hay ninguna garant¡a que las propinas sean reclamadas por los desarrolladores."
- line3: "Al donar fondos, usted esta de acuerdo que los fondos podrán ser enviados a la fundación de software gratuito (Free Software Foundation) o a otra parte a nuestra discreción."
+ line1: "Tip4Commit no está asociado con la mayor¡a de los proyectos."
+ line2: "No hay ninguna garant¡a que las propinas sean reclamadas por los desarrolladores."
+ line3: "Al donar fondos, usted esta de acuerdo que los fondos podrán ser enviados a la fundación de software gratuito (Free Software Foundation) o a otra parte a nuestra discreción."
From a0c58153fef592658faa25985212c69227aa986a Mon Sep 17 00:00:00 2001
From: Merco
Date: Wed, 6 Dec 2017 23:48:40 -0800
Subject: [PATCH 009/159] Fixed red dots
Some red dots were showing up. Apparently, they're stray Unicode characters or something. Fixed that, too.
---
config/locales/es.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/config/locales/es.yml b/config/locales/es.yml
index bbc1a1c6..9cfe20e6 100644
--- a/config/locales/es.yml
+++ b/config/locales/es.yml
@@ -24,7 +24,7 @@ es:
can_assign_more_tips: "No puede asignar más de 100% de los fondos disponibles."
wrong_bitcoin_address: Ocurrió un error al actualizar su dirección de bitcoin
user_not_found: No se pudo encontrar el usuario
- access_denied: ÂUsted no está autorizado para realizar esa acción!
+ access_denied: Usted no está autorizado para realizar esa acción!
notices:
project_updated: Las configuraciones de su proyecto fueron actualizadas.
tips_decided: La cantidad de propina ha sido definida.
@@ -64,7 +64,7 @@ es:
button: Busca o agrega un proyecto
contribute:
title: Contribuye
- text: Ve y arregla algo. Si tu commit es aceptado por el mantenedor del proyecto, Ârecibirás una propina!
+ text: Ve y arregla algo. Si tu commit es aceptado por el mantenedor del proyecto, recibirás una propina!
sign_in_text: "Solo cheque su bandeja por una invitación o %{sign_in_link}."
sign_up_text: "Si usted a£n no ha recibido una invitación, se puede %{sign_up_link} con un correo electrónico valido."
button: Proyectos soportados
From f86c5b09b16e219739f7370782bd91d711827b13 Mon Sep 17 00:00:00 2001
From: Merco
Date: Thu, 7 Dec 2017 00:07:54 -0800
Subject: [PATCH 010/159] Fixed a parsing error
Let's hope it works now.
---
config/locales/es.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/config/locales/es.yml b/config/locales/es.yml
index 9cfe20e6..f719b8ac 100644
--- a/config/locales/es.yml
+++ b/config/locales/es.yml
@@ -19,7 +19,7 @@ es:
create_issue: crea un problema
errors:
project_not_found: El proyecto no fue encontrado.
- opt_in_notice: "Debido a varias quejas de mantenedores de proyectos, no agregamos proyectos automáticamente. Proyectos existentes sin depósitos han sido removidos. Si usted quiere agregar su proyecto, por favor %{create_issue_link}.
+ opt_in_notice: "Debido a varias quejas de mantenedores de proyectos, no agregamos proyectos automáticamente. Proyectos existentes sin depósitos han sido removidos. Si usted quiere agregar su proyecto, por favor %{create_issue_link}."
access_denied: Acceso rechazado
can_assign_more_tips: "No puede asignar más de 100% de los fondos disponibles."
wrong_bitcoin_address: Ocurrió un error al actualizar su dirección de bitcoin
@@ -105,7 +105,7 @@ es:
when_decided: cuando la cantidad sea decidida
next_tip: Siguiente Propina
contribute_and_earn: Contribuye y Gana
- contribute_and_earn_description: "Dona Bitcoins a este proyecto o %{make_commits_link} y recibe propinas por ellos. Si tu commit es aceptado %{branch} por un mantenedor de proyecto y hay Bitcoins disponibles, Ârecibirás una propina!"
+ contribute_and_earn_description: "Dona Bitcoins a este proyecto o %{make_commits_link} y recibe propinas por ellos. Si tu commit es aceptado %{branch} por un mantenedor de proyecto y hay Bitcoins disponibles, recibirás una propina!"
contribute_and_earn_branch: "al %{branch} branch"
make_commits_link: haz commits
tell_us_bitcoin_address: Solo %{tell_us_link} su dirección de Bitcoin.
From 272efbc30f143b417dab9dfb62584f572b7a2b5c Mon Sep 17 00:00:00 2001
From: Merco
Date: Thu, 7 Dec 2017 19:21:12 -0800
Subject: [PATCH 011/159] Added missing exclamation marks.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Some exclamations marks were missing their upside down question marks. Fixed that. And some additional `ú`s.
---
config/locales/es.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/config/locales/es.yml b/config/locales/es.yml
index f719b8ac..7e71afb7 100644
--- a/config/locales/es.yml
+++ b/config/locales/es.yml
@@ -29,7 +29,7 @@ es:
project_updated: Las configuraciones de su proyecto fueron actualizadas.
tips_decided: La cantidad de propina ha sido definida.
user_updated: La información ha sido actualizada.
- user_unsubscribed: "Usted ya no recibirá notificaciones de nosotros. Nos disculpamos por haberte molestado. Pero a£n puede dejar su dirección de bitcoin para recibir sus propinas."
+ user_unsubscribed: "Usted ya no recibirá notificaciones de nosotros. Nos disculpamos por haberte molestado. Pero aún puede dejar su dirección de bitcoin para recibir sus propinas."
tip_amounts:
undecided: "Indeciso"
free: "Gratis: 0%"
@@ -66,7 +66,7 @@ es:
title: Contribuye
text: Ve y arregla algo. Si tu commit es aceptado por el mantenedor del proyecto, recibirás una propina!
sign_in_text: "Solo cheque su bandeja por una invitación o %{sign_in_link}."
- sign_up_text: "Si usted a£n no ha recibido una invitación, se puede %{sign_up_link} con un correo electrónico valido."
+ sign_up_text: "Si usted aún no ha recibido una invitación, se puede %{sign_up_link} con un correo electrónico valido."
button: Proyectos soportados
projects:
index:
From f8eae053dbe21d4ea06324dadd40d5f727a83740 Mon Sep 17 00:00:00 2001
From: Merco
Date: Thu, 7 Dec 2017 19:25:31 -0800
Subject: [PATCH 012/159] ignore me
fixed mroe stuff
---
config/locales/es.yml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/config/locales/es.yml b/config/locales/es.yml
index 7e71afb7..dd9128b7 100644
--- a/config/locales/es.yml
+++ b/config/locales/es.yml
@@ -24,7 +24,7 @@ es:
can_assign_more_tips: "No puede asignar más de 100% de los fondos disponibles."
wrong_bitcoin_address: Ocurrió un error al actualizar su dirección de bitcoin
user_not_found: No se pudo encontrar el usuario
- access_denied: Usted no está autorizado para realizar esa acción!
+ access_denied: ¡Usted no está autorizado para realizar esa acción!
notices:
project_updated: Las configuraciones de su proyecto fueron actualizadas.
tips_decided: La cantidad de propina ha sido definida.
@@ -64,7 +64,7 @@ es:
button: Busca o agrega un proyecto
contribute:
title: Contribuye
- text: Ve y arregla algo. Si tu commit es aceptado por el mantenedor del proyecto, recibirás una propina!
+ text: Ve y arregla algo. Si tu commit es aceptado por el mantenedor del proyecto, ¡recibirás una propina!
sign_in_text: "Solo cheque su bandeja por una invitación o %{sign_in_link}."
sign_up_text: "Si usted aún no ha recibido una invitación, se puede %{sign_up_link} con un correo electrónico valido."
button: Proyectos soportados
@@ -90,7 +90,7 @@ es:
deposits: depositos
custom_tip_size: (cada nuevo commit recibe un porcentaje del balance disponible)
default_tip_size: "(cada nuevo commit recibe %{percentage} del balance disponible)"
- min_tip_size: "La propina m¡nima es de %{min_tip}, pero si el balance disponible es menor de la propina m¡nima, una propina más pequeña será enviada"
+ min_tip_size: "La propina m¡nima es de %{min_tip}, pero si el balance disponible es menor de la propina mÃnima, una propina más pequeña será enviada"
unconfirmed_amount: "(%{amount} no confirmado)"
tipping_policies: Pol¡tica de propina
updated_by_user: "(Ultimo cambio por %{name} el %{date})"
@@ -105,7 +105,7 @@ es:
when_decided: cuando la cantidad sea decidida
next_tip: Siguiente Propina
contribute_and_earn: Contribuye y Gana
- contribute_and_earn_description: "Dona Bitcoins a este proyecto o %{make_commits_link} y recibe propinas por ellos. Si tu commit es aceptado %{branch} por un mantenedor de proyecto y hay Bitcoins disponibles, recibirás una propina!"
+ contribute_and_earn_description: "Dona Bitcoins a este proyecto o %{make_commits_link} y recibe propinas por ellos. Si tu commit es aceptado %{branch} por un mantenedor de proyecto y hay Bitcoins disponibles, ¡recibirás una propina!"
contribute_and_earn_branch: "al %{branch} branch"
make_commits_link: haz commits
tell_us_bitcoin_address: Solo %{tell_us_link} su dirección de Bitcoin.
From 6bdda7db0bd39ee6c515fcc9113ef61ed5dccfa6 Mon Sep 17 00:00:00 2001
From: Merco
Date: Thu, 7 Dec 2017 19:41:10 -0800
Subject: [PATCH 013/159] Added a Spanish README.
I'll leave the implementation of this REAME file to you guys.
---
README_ES.md | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
create mode 100644 README_ES.md
diff --git a/README_ES.md b/README_ES.md
new file mode 100644
index 00000000..883cec0b
--- /dev/null
+++ b/README_ES.md
@@ -0,0 +1,25 @@
+Tip4commit
+==========
+
+[](https://tip4commit.com/projects/307)
+[](https://travis-ci.org/tip4commit/tip4commit)
+
+Dona Bitcoins a proyectos de código abierto o recibe propinas contribuciones de código.
+
+Nombre | Enlace
+----|----|
+Sitio Oficial| https://tip4commit.com/
+Discusiones| https://bitcointalk.org/index.php?topic=31580
+Preguntas Frecuentes | https://github.com/tip4commit/tip4commit/wiki/FAQ
+Problemas| https://github.com/tip4commit/tip4commit/issues
+
+Desarrolladores
+==========
+
+Si a usted le gustarÃa contribuir al desarrollo de tip4commit, puede encontrar las guÃas de contribución en el [README para desarolladores.](https://github.com/tip4commit/tip4commit/wiki/Developer-README)
+
+
+Licencia
+=======
+
+[Licencia MIT](https://github.com/tip4commit/tip4commit/blob/master/LICENSE)
From 32b4506f9f93807c175833959ceef8bfc4bfee6d Mon Sep 17 00:00:00 2001
From: Rizky Eko
Date: Sat, 9 Dec 2017 16:32:17 +0700
Subject: [PATCH 014/159] Add Indonesian translation for lacale
---
config/locales/id.yml | 233 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 233 insertions(+)
create mode 100644 config/locales/id.yml
diff --git a/config/locales/id.yml b/config/locales/id.yml
new file mode 100644
index 00000000..d1db7880
--- /dev/null
+++ b/config/locales/id.yml
@@ -0,0 +1,233 @@
+en:
+ tip4commit: Tip4Commit
+ meta:
+ title: Kontribusi ke Open Source
+ description: Donasi bitcoin untuk proyek Open Source atau commit perubahan dan dapatkan tips.
+ menu:
+ home: Home
+ projects: proyek
+ footer:
+ text: "Source code bisa dicek di %{github_link} dan proyek juga dapat cek di- %{support_link}."
+ github_link: GitHub
+ support_link: support
+ follow_link: Follow @tip4commit
+ links:
+ sign_up: Daftar
+ sign_in: Masuk
+ sign_in_imp: masuk
+ sign_out: Keluar
+ create_issue: Buat Issue
+ errors:
+ project_not_found: proyek tidak ditemukan.
+ opt_in_notice: "Karena keluhan dari pemilik proyek, kami tidak menambahkan proyek secara otomatis lagi. Proyek yang ada tanpa deposit telah dihapus. Jika Anda ingin menambahkan proyek Anda, silakan klik %{create_issue_link}."
+ access_denied: Akses ditolak
+ can_assign_more_tips: "proyek tidak dapat menetapkan lebih dari 100% dari dana yang tersedia."
+ wrong_bitcoin_address: Error ketika memperbarui alamat bitcoin
+ user_not_found: User tidak ditemukan
+ access_denied: Anda tidak berwenang melakukan tindakan ini!
+ notices:
+ project_updated: Settingan proyek telah diperbarui
+ tips_decided: Jumlah tips sudah ditetapkan
+ user_updated: Informasi proyek telah disimpan!
+ user_unsubscribed: "proyek telah berhenti berlangganan! Maaf atas ketidaknyamanannya. Meski begitu, Anda masih bisa meninggalkan alamat bitcoin Anda untuk mendapatkan tip Anda."
+ tip_amounts:
+ undecided: "Bimbang"
+ free: "Gratis: 0%"
+ tiny: "Sangat Kecil: 0.1%"
+ small: "Kecil: 0.5%"
+ normal: "Sedang: 1%"
+ big: "Besar: 2%"
+ huge: "Sangat Besar: 5%"
+ js:
+ errors:
+ value:
+ invalid: Nilai tidak valid
+ email:
+ invalid: Alamat email tidak valid
+ blank: Email harus diisi dan tidak boleh kosong
+ password:
+ blank: Password harus diisi dan tidak boleh kosong
+ invalid: Password tidak sama
+ password_confirmation:
+ blank: Password konfirmasi harus diisi dan tidak boleh kosong
+ invalid: Password tidak sama
+ home:
+ index:
+ see_projects: Lihat proyek
+ how_does_it_work:
+ title: Bagaimana cara kerjanya?
+ text: Orang menyumbangkan bitcoin untuk proyek. Ketika komit seseorang diterima dalam repositori proyek, kami secara otomatis memberi tip kepada kontributor.
+ button: Pelajari tentang Bitcoin
+ donate:
+ title: Donasi
+ text: Temukan proyek yang Anda sukai dan setorkan bitcoin ke dalamnya. Sumbangan Anda akan terakumulasi dengan dana donatur lain untuk diberikan sebagai tip untuk setiap perubahan baru.
+ button: Cari atau tambahkan proyek
+ contribute:
+ title: Membantu
+ text: Tambahkan atau perbaiki sesuatu! Jika perubahan proyek diterima oleh pemilik proyek, proyek akan mendapatkan tip!
+ sign_in_text: "Silahkan cek email untuk melihat undangan atau %{sign_in_link}."
+ sign_up_text: "Jika proyek tidak menerima undangan, proyek bisa %{sign_up_link} dengan alamat email yang valid"
+ button: Supported proyek
+ projects:
+ index:
+ find_project:
+ placeholder: Masukkan GitHub proyek URL atau keyword apapun untuk mencari proyek...
+ button: Temukan proyek
+ repository: Repository
+ description: Deskripsi
+ watchers: Pengintai
+ balance: Saldo
+ forked_from: Cabang dari
+ support: Support proyek
+ show:
+ title: "Membantu %{project}"
+ fetch_pending: (Gagal initial fetch)
+ edit_project: Rubah pengaturan proyek
+ decide_tip_amounts: Tentukan nilai tip
+ disabled_notifications: "Pemilik proyek telah memutuskan untuk tidak memberi tahu kontributor baru tentang tip dan mereka mungkin tidak menyukai cara pendanaan ini."
+ fee: "%{percentage} dana yang disetorkan akan digunakan untuk memberi tip pada komitmen baru."
+ balance: Saldo
+ deposits: setor
+ custom_tip_size: (setiap perubahan baru menerima persentase saldo yang tersedia)
+ default_tip_size: "(setiap perubahan baru menerima %{percentage} dari jumlah saldo yang tersedia)"
+ min_tip_size: "Jumlah tip minimum adalah %{min_tip}, Tapi bila tersedia saldo kurang dari itu maka akan dikirim sebagai tip yang lebih kecil"
+ unconfirmed_amount: "(%{amount} belum dikonfirmasi)"
+ tipping_policies: Aturan tip
+ updated_by_user: "(Perubahan terakhir oleh %{name} pada %{date})"
+ updated_by_unknown: "(Perubahan terakhir pada %{date})"
+ tips_paid: Tip yang sudah dibayarkan
+ unclaimed_amount: "(%{amount} yang belum di klaim, dan akan dikembalikan ke proyek setelah 1 bulan jika tidak diklaim.)"
+ last_tips: Tip tearkhir
+ see_all: Lihat semua
+ received: "Diterima %{amount}"
+ will_receive: akan menerima tip
+ for_commit: untuk perubahan
+ when_decided: kapan jumlahnya ditentukan
+ next_tip: tip berikutnya
+ contribute_and_earn: Bantu dan dapatkan tip
+ contribute_and_earn_description: "Donasi bitcoin ke proyek ini atau %{make_commits_link} dan dapatkan tipnya. Jika perubahan proyek diterima %{branch} oleh pemilik proyek dan saldo bitcoin tersedia, proyek akan mendapatkan tip!"
+ contribute_and_earn_branch: "Ke branch %{branch}"
+ make_commits_link: buat perubahan
+ tell_us_bitcoin_address: "Cantumkan %{tell_us_link} alamat bitcoin proyek."
+ tell_us_link: cantumkan
+ sign_in: "Silahkan cek email proyek atau %{sign_in_link}."
+ promote_project: Majukan %{project}
+ embedding: Penyematan
+ image_url: "Image URL:"
+ shield_title: tip untuk komit selanjutnya
+ edit:
+ project_settings: "%{project} settingan proyek"
+ branch: Branch
+ default_branch: Default branch
+ tipping_policies: Aturan tip
+ hold_tips: "Jangan segera mengirim tip. Berikan kolaborator untuk mengubah tip sebelum dikirim"
+ save: Simpan settingan proyek
+ disable_notifications: Jangan beritahu kontributor baru
+ decide_tip_amounts:
+ commit: Komit
+ author: Penulis
+ message: Pesan
+ tip: Tip (relatif terhadap saldo proyek)
+ submit: Kirim jumlah yang sudah ditentukan
+ blacklisted:
+ title: Maaf, proyek ini tidak menerima ini!
+ message: Penulis proyek ini telah melarang tip untuk proyek ini.
+ tips:
+ index:
+ tips: Tips
+ project_tips: '%{project} tips'
+ user_tips: "%{user} tips"
+ created_at: Dibuat pada
+ commiter: Penulis
+ project: Proyek
+ commit: Perubahan
+ amount: Jumlah
+ refunded: Dikembalikan ke proyek deposit
+ undecided: Jumlah tip belum ditentukan
+ no_bitcoin_address: Pengguna belum menentukan alamat penarikan
+ below_threshold: "Saldo pengguna berada di bawah ambang panarikan"
+ waiting: Menunggu penarikan
+ error: (kesalahan pengiriman transaksi)
+ deposits:
+ index:
+ project_deposits: '%{project} setor'
+ deposits: Setor
+ created_at: Dibuat pada
+ project: Proyek
+ amount: Jumlah
+ transaction: Transaksi
+ confirmed: Dikonfirmasi
+ confirmed_yes: 'Ya'
+ confirmed_no: 'Tidak'
+ users:
+ index:
+ title: Kontributor teratas
+ name: Nama
+ commits_count: Perubahan yang sudah di tip
+ withdrawn: Ditarik
+ show:
+ balance: Saldo
+ threshold: "Anda akan mendapatkan uang anda saat saldo anda mencapai ambang batas %{threshold}"
+ see_all: lihat semua
+ received: "%{time} diterima %{amount} untuk perubahan %{commit} di %{project}"
+ bitcoin_address_placeholder: Alamat bitcoin anda
+ notify: Beritahu saya tentang tip baru(tidak lebih dari satu email per bulan)
+ submit_user: Perbarui informasi pengguna
+ change_password: Rubah password anda
+ submit_password: Rubah password
+ use_from_gravatar: Gunakan dari profil gravatar anda
+ withdrawals:
+ index:
+ title: Penarikan Terakhir
+ created_at: Diabuat Pada
+ transaction: Transaksi
+ result: Hasil
+ error: Eror
+ success: Sukses
+ devise:
+ sessions:
+ new:
+ title: Masuk
+ remember_me: Ingat saya
+ submit: Masuk
+ registrations:
+ new:
+ title: Daftar
+ submit: Daftar
+ passwords:
+ new:
+ title: Lupa password?
+ submit: Kirim instruksi reset password
+ edit:
+ title: Rubah password anda
+ submit: Rubah password
+ confirmations:
+ new:
+ title: Kirim ulang konfirmasi
+ submit: Kirim ulang konfirmasi
+ links:
+ sign_in: Masuk
+ sign_up: Daftar
+ recover: Lupas password?
+ confirm: Tidak menerika konfirmasi?
+ sign_in_with: "Masuk dengan %{provider}"
+ errors:
+ primary_email: email utama harus terverifikasi.
+ onmiauth_info: tidak dapat mengambil informasi.
+ activerecord:
+ attributes:
+ user:
+ email: E-mail
+ bitcoin_address: Alamat bitcoin
+ password: Password
+ password_confirmation: Konfirmasi Password
+ display_name: Nama yang ditampilkan
+ omniauth_providers:
+ github: GitHub
+ bitbucket: BitBucket
+ general:
+ or: atau
+ disclaimer:
+ line1: "Tip4Commit tidak berafiliasi dengan sebagian besar proyek."
+ line2: "Tidak ada jaminan bahwa tip akan diklaim oleh pengembang."
+ line3: "Dengan menyumbangkan dana, Anda setuju bahwa mereka dapat dikirim ke Free Software Fondattion atau tempat lain dengan kebijakan Tip4Commit."
From 6935f3ba3cc81372057b2cde143882e192fc9360 Mon Sep 17 00:00:00 2001
From: Rizky Eko
Date: Sun, 10 Dec 2017 10:14:41 +0700
Subject: [PATCH 015/159] change en to id
---
config/locales/id.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/locales/id.yml b/config/locales/id.yml
index d1db7880..2460966f 100644
--- a/config/locales/id.yml
+++ b/config/locales/id.yml
@@ -1,4 +1,4 @@
-en:
+id:
tip4commit: Tip4Commit
meta:
title: Kontribusi ke Open Source
From b9738fd6c64e671c491fdb8942f68e07dd7bd331 Mon Sep 17 00:00:00 2001
From: ohbarye
Date: Tue, 19 Dec 2017 02:00:06 +0900
Subject: [PATCH 016/159] Add ja locale
---
config/locales/ja.yml | 233 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 233 insertions(+)
create mode 100644 config/locales/ja.yml
diff --git a/config/locales/ja.yml b/config/locales/ja.yml
new file mode 100644
index 00000000..450db782
--- /dev/null
+++ b/config/locales/ja.yml
@@ -0,0 +1,233 @@
+ja:
+ tip4commit: Tip4Commit
+ meta:
+ title: オープンソースã«è²¢çŒ®ã—よã†
+ description: オープンソースプãƒã‚¸ã‚§ã‚¯ãƒˆã«ãƒ“ットコインを寄付ã—ã¦è²¢çŒ®ã™ã‚‹ã€ã¾ãŸã¯ã‚³ãƒ¼ãƒ‰ã‚’書ã„ã¦ãƒãƒƒãƒ—を得よã†
+ menu:
+ home: ホーãƒ
+ projects: プãƒã‚¸ã‚§ã‚¯ãƒˆ
+ footer:
+ text: "本サイトã®ã‚½ãƒ¼ã‚¹ã‚³ãƒ¼ãƒ‰ã¯%{github_link}ã§å…¬é–‹ã•れã¦ãŠã‚Šã€%{support_link}ã‹ã‚‰è²¢çŒ®ã™ã‚‹ã“ã¨ã‚‚ã§ãã¾ã™ã€‚"
+ github_link: GitHub
+ support_link: ã“ã¡ã‚‰
+ follow_link: "@tip4commit をフォãƒãƒ¼"
+ links:
+ sign_up: 登録
+ sign_in: ãƒã‚°ã‚¤ãƒ³
+ sign_in_imp: ãƒã‚°ã‚¤ãƒ³
+ sign_out: ãƒã‚°ã‚¢ã‚¦ãƒˆ
+ create_issue: issueを作æˆã—ã¦ãã ã•ã„
+ errors:
+ project_not_found: プãƒã‚¸ã‚§ã‚¯ãƒˆãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“ã§ã—ãŸã€‚
+ opt_in_notice: "プãƒã‚¸ã‚§ã‚¯ãƒˆç®¡ç†è€…ã‹ã‚‰ã®è¦æœ›ã«ã‚ˆã‚Šãƒ—ãƒã‚¸ã‚§ã‚¯ãƒˆã¯è‡ªå‹•çš„ã«è¿½åŠ ã•れãªã„よã†ã«ã—ã€ã¾ãŸã€é 金ã®ãªã„プãƒã‚¸ã‚§ã‚¯ãƒˆã¯å‰Šé™¤ã—ã¾ã—ãŸã€‚ã‚‚ã—ã”自身ã®ãƒ—ãƒã‚¸ã‚§ã‚¯ãƒˆã‚’è¿½åŠ ã—ãŸã„å ´åˆã¯%{}。"
+ access_denied: ã‚¢ã‚¯ã‚»ã‚¹ãŒæ‹’å¦ã•れã¾ã—ãŸã€‚
+ can_assign_more_tips: "資金ã®100%ã‚’è¶…ãˆã¦å‰²ã‚Šå½“ã¦ã‚‹ã“ã¨ã¯ã§ãã¾ã›ã‚“。"
+ wrong_bitcoin_address: ãƒ“ãƒƒãƒˆã‚³ã‚¤ãƒ³ã‚¢ãƒ‰ãƒ¬ã‚¹ã®æ›´æ–°ã«å¤±æ•—ã—ã¾ã—ãŸã€‚
+ user_not_found: ユーザーãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“ã§ã—ãŸã€‚
+ access_denied: ã“ã®æ“ä½œã‚’è¡Œã†æ¨©é™ãŒã‚りã¾ã›ã‚“。
+ notices:
+ project_updated: プãƒã‚¸ã‚§ã‚¯ãƒˆã®è¨å®šã‚’æ›´æ–°ã—ã¾ã—ãŸã€‚
+ tips_decided: ãƒãƒƒãƒ—ã®é‡ã‚’è¨å®šã—ã¾ã—ãŸã€‚
+ user_updated: ãƒ¦ãƒ¼ã‚¶ãƒ¼æƒ…å ±ã‚’ä¿å˜ã—ã¾ã—ãŸã€‚
+ user_unsubscribed: "è³¼èªã‚’åœæ¢ã—ã¾ã—ãŸã€‚ã”迷惑をãŠã‹ã‘ã—ã¦ç”³ã—訳ã‚りã¾ã›ã‚“。ãƒãƒƒãƒ—ã‚’å¾—ã‚‹ãŸã‚ã®ãƒ“ットコインアドレスã¯å¼•ãç¶šãæœ‰åйã§ã™ã€‚"
+ tip_amounts:
+ undecided: "未入力"
+ free: "ç„¡æ–™: 0%"
+ tiny: "極å°: 0.1%"
+ small: "å°: 0.5%"
+ normal: "ä¸: 1%"
+ big: "大: 2%"
+ huge: "特大: 5%"
+ js:
+ errors:
+ value:
+ invalid: 値ãŒä¸æ£ã§ã™ã€‚
+ email:
+ invalid: 䏿£ãªãƒ¡ãƒ¼ãƒ«ã‚¢ãƒ‰ãƒ¬ã‚¹ã§ã™ã€‚
+ blank: メールアドレスã¯å¿…é ˆã§ã™ã€‚
+ password:
+ blank: パスワードã¯å¿…é ˆã§ã™ã€‚
+ invalid: パスワードã¨ãƒ‘スワード確èªãŒä¸€è‡´ã—ã¾ã›ã‚“。
+ password_confirmation:
+ blank: パスワード確èªã¯å¿…é ˆã§ã™ã€‚
+ invalid: パスワードã¨ãƒ‘スワード確èªãŒä¸€è‡´ã—ã¾ã›ã‚“。
+ home:
+ index:
+ see_projects: プãƒã‚¸ã‚§ã‚¯ãƒˆã‚’見る
+ how_does_it_work:
+ title: ã©ã‚“ãªä»•組ã¿ï¼Ÿ
+ text: オープンソースプãƒã‚¸ã‚§ã‚¯ãƒˆã«ãƒ“ットコインã§å¯„付ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚ã¾ãŸã€ã‚³ãƒŸãƒƒãƒˆãŒãƒ—ãƒã‚¸ã‚§ã‚¯ãƒˆã®ãƒ¬ãƒã‚¸ãƒˆãƒªã«å–り込ã¾ã‚ŒãŸå ´åˆã«è‡ªå‹•çš„ã«ãƒãƒƒãƒ—ã‚’ã‚³ãƒ³ãƒˆãƒªãƒ“ãƒ¥ãƒ¼ã‚¿ãƒ¼ã«æ”¯æ‰•ã„ã¾ã™ã€‚
+ button: ビットコインã«ã¤ã„ã¦å¦ã¶
+ donate:
+ title: 寄付ã™ã‚‹
+ text: ã‚ãªãŸã®å¯„付ã—ãŸã„プãƒã‚¸ã‚§ã‚¯ãƒˆã‚’見ã¤ã‘ã¦é€é‡‘ã—ã¾ã—ょã†ã€‚ã‚ãªãŸã®å¯„付ã¯ã€ä»–ã®å¯„付者ã®å¯„付金ã¨ã¨ã‚‚ã«è“„ç©ã•れã€ãã®è³‡é‡‘ã¯æ–°ãŸãªã‚³ãƒŸãƒƒãƒˆã¸ã®ãƒãƒƒãƒ—ã¨ã—ã¦ä½¿ç”¨ã•れã¾ã™ã€‚
+ button: プãƒã‚¸ã‚§ã‚¯ãƒˆã‚’探ã™
+ contribute:
+ title: コントリビュートã™ã‚‹
+ text: 何ã‹ã‚³ãƒ¼ãƒ‰ã‚’書ã„ã¦ã¿ã¾ã—ょã†ï¼ã‚ãªãŸã®ã‚³ãƒŸãƒƒãƒˆãŒãƒ—ãƒã‚¸ã‚§ã‚¯ãƒˆç®¡ç†è€…ã«ã‚ˆã£ã¦å–り込ã¾ã‚Œã‚Œã°ãƒãƒƒãƒ—ã‚’å¾—ã‚‹ã“ã¨ãŒã§ãã¾ã™ï¼
+ sign_in_text: "招待メールを確èªã™ã‚‹ã€ã¾ãŸã¯%{sign_in_link}ã—ã¦ãã ã•ã„。"
+ sign_up_text: "ã‚‚ã—ã¾ã 招待メールをå—ã‘å–ã£ã¦ã„ãªã‘れã°%{sign_up_link}リンクã‹ã‚‰ç™»éŒ²ã—ã¦ãã ã•ã„。"
+ button: プãƒã‚¸ã‚§ã‚¯ãƒˆã‚’探ã™
+ projects:
+ index:
+ find_project:
+ placeholder: GitHubプãƒã‚¸ã‚§ã‚¯ãƒˆã®URLã€ã¾ãŸã¯æ¤œç´¢ãƒ¯ãƒ¼ãƒ‰ã‚’入力ã—ã¦ãã ã•ã„。
+ button: 検索
+ repository: レãƒã‚¸ãƒˆãƒª
+ description: 説明
+ watchers: ウォッãƒãƒ£ãƒ¼
+ balance: 残高
+ forked_from: フォーク元
+ support: 支æ´ã™ã‚‹
+ show:
+ title: "%{project}ã«è²¢çŒ®ã™ã‚‹"
+ fetch_pending: ï¼ˆæƒ…å ±å–å¾—ä¸ï¼‰
+ edit_project: プãƒã‚¸ã‚§ã‚¯ãƒˆã®è¨å®šå¤‰æ›´
+ decide_tip_amounts: ãƒãƒƒãƒ—ã®é‡‘é¡ã‚’決ã‚ã‚‹
+ disabled_notifications: "プãƒã‚¸ã‚§ã‚¯ãƒˆç®¡ç†è€…ã«ã‚ˆã£ã¦ã€æ–°ã—ã„コントリビューターã«ãƒãƒƒãƒ—ã«ã¤ã„ã¦é€šçŸ¥ã—ãªã„ã“ã¨ã«ãªã£ã¦ã„ã¾ã™ã€‚(ãŠãらãã€ã“ã®è³‡é‡‘èª¿é”æ–¹æ³•ãŒå¥½ã¾ã—ããªã„ãŸã‚)"
+ fee: "é 金ã®%{percentage}ãŒæ–°ã—ã„コミットã¸ã®ãƒãƒƒãƒ—ã«ä½¿ç”¨ã•れã¾ã™ã€‚"
+ balance: 残高
+ deposits: é 金
+ custom_tip_size: (新ã—ã„コミットã”ã¨ã«åˆ©ç”¨å¯èƒ½ãªæ®‹é«˜ã®ä¸€éƒ¨ã‚’å—ã‘å–りã¾ã™ï¼‰
+ default_tip_size: "(新ã—ã„コミットã”ã¨ã«åˆ©ç”¨å¯èƒ½ãªæ®‹é«˜ã®%{percentage}ã‚’å—ã‘å–る)"
+ min_tip_size: "最å°ã®ãƒãƒƒãƒ—ã®ã‚µã‚¤ã‚ºã¯%{min_tip}ã§ã™ãŒåˆ©ç”¨å¯èƒ½æ®‹é«˜ãŒã“れより低ã„å ´åˆã€ãã®é‡‘é¡ãŒãƒãƒƒãƒ—ã¨ã—ã¦æ”¯æ‰•ã‚れã¾ã™ã€‚"
+ unconfirmed_amount: "(%{amount}ãŒæœªç¢ºèªã§ã™)"
+ tipping_policies: ãƒãƒƒãƒ—ãƒãƒªã‚·ãƒ¼
+ updated_by_user: "(最終更新者 %{name} 最終更新日 %{date})"
+ updated_by_unknown: "(最終更新日 %{date})"
+ tips_paid: 支払ã£ãŸãƒãƒƒãƒ—
+ unclaimed_amount: "(ã“ã®ã†ã¡%{amount}ã¯æœªè«‹æ±‚ã§ã™ã€‚1ヶ月間請求ãŒãªã„å ´åˆã¯ãƒ—ãƒã‚¸ã‚§ã‚¯ãƒˆã«è¿”金ã•れã¾ã™ï¼‰"
+ last_tips: 最新ã®ãƒãƒƒãƒ—
+ see_all: å…¨ã¦è¦‹ã‚‹
+ received: "ãŒ%{amount}å—ã‘å–りã¾ã—ãŸã€‚"
+ will_receive: "ã¯ãƒãƒƒãƒ—ã‚’å—ã‘å–る予定ã§ã™ã€‚"
+ for_commit: 対象ã®ã‚³ãƒŸãƒƒãƒˆ
+ when_decided: ï¼ˆé‡‘é¡æ±ºå®šæ™‚)
+ next_tip: 次ã®ãƒãƒƒãƒ—
+ contribute_and_earn: 貢献ã—ã¦åŽå…¥ã‚’å¾—ã‚‹
+ contribute_and_earn_description: "ビットコインをプãƒã‚¸ã‚§ã‚¯ãƒˆã«å¯„付ã™ã‚‹ã‹ã€ï¼…{make_commits_link}ã—ã¾ã—ょã†ã€‚ã‚ãªãŸã®ã‚³ãƒŸãƒƒãƒˆãŒãƒ—ãƒã‚¸ã‚§ã‚¯ãƒˆç®¡ç†è€…ã«ã‚ˆã£ã¦ï¼…{branch}ã«å—ã‘入れられã€ã‹ã¤åˆ©ç”¨å¯èƒ½æ®‹é«˜ãŒã‚ã‚‹å ´åˆã¯ãƒãƒƒãƒ—を得られã¾ã™ï¼"
+ contribute_and_earn_branch: "%{branch}"
+ make_commits_link: コミット
+ tell_us_bitcoin_address: "ビットコインアドレスを%{tell_us_link}ã‹ã‚‰å…¥åŠ›ã—ã¦ãã ã•ã„。"
+ tell_us_link: ã“ã¡ã‚‰
+ sign_in: "招待メールを確èªã™ã‚‹ã€ã¾ãŸã¯%{sign_in_link}ã—ã¦ãã ã•ã„。"
+ promote_project: "%{project}を応æ´ã™ã‚‹"
+ embedding: 埋ã‚è¾¼ã¿
+ image_url: "Image URL:"
+ shield_title: tip for next commit
+ edit:
+ project_settings: "%{project}ã®ãƒ—ãƒã‚¸ã‚§ã‚¯ãƒˆè¨å®š"
+ branch: ブランãƒ
+ default_branch: デフォルトブランãƒ
+ tipping_policies: ãƒãƒƒãƒ—ãƒãƒªã‚·ãƒ¼
+ hold_tips: "ãƒãƒƒãƒ—ã‚’ã™ãã«é€é‡‘ã—ãªã„。共åŒç®¡ç†è€…ã«é€ä¿¡å‰ã«ãƒãƒƒãƒ—ã®é‡‘é¡ã‚’ä¿®æ£ã™ã‚‹æ©Ÿä¼šã‚’æä¾›ã™ã‚‹ã€‚"
+ save: プãƒã‚¸ã‚§ã‚¯ãƒˆè¨å®šã‚’ä¿å˜ã™ã‚‹
+ disable_notifications: æ–°ã—ã„コントリビューターã«é€šçŸ¥ã—ãªã„
+ decide_tip_amounts:
+ commit: コミット
+ author: 作者
+ message: メッセージ
+ tip: ãƒãƒƒãƒ—(プãƒã‚¸ã‚§ã‚¯ãƒˆã®æ®‹é«˜ã¨ã®ç›¸å¯¾å€¤ï¼‰
+ submit: é¸æŠžã—ãŸãƒãƒƒãƒ—ã®é‡‘é¡ã‚’é€ã‚‹
+ blacklisted:
+ title: 申ã—訳ã‚りã¾ã›ã‚“ãŒã€ã“ã®ãƒ—ãƒã‚¸ã‚§ã‚¯ãƒˆã¯ãƒãƒƒãƒ—ã‚’å—ã‘付ã‘ã¦ã„ã¾ã›ã‚“ï¼
+ message: ã“ã®ãƒ—ãƒã‚¸ã‚§ã‚¯ãƒˆã®ä½œè€…ã¯ãƒãƒƒãƒ—を許容ã—ãªã„é¸æŠžã‚’ã—ã¾ã—ãŸã€‚
+ tips:
+ index:
+ tips: ãƒãƒƒãƒ—
+ project_tips: '%{project} ãƒãƒƒãƒ—一覧'
+ user_tips: "%{user} ãƒãƒƒãƒ—一覧"
+ created_at: ä½œæˆæ—¥
+ commiter: コミッター
+ project: プãƒã‚¸ã‚§ã‚¯ãƒˆ
+ commit: コミット
+ amount: 金é¡
+ refunded: プãƒã‚¸ã‚§ã‚¯ã«è¿”金済
+ undecided: プãƒã‚¸ã‚§ã‚¯ãƒˆã®ãƒãƒƒãƒ—金顿œªæ±ºå®š
+ no_bitcoin_address: ユーザーã®ãƒ“ットコインアドレス未登録
+ below_threshold: ãƒ¦ãƒ¼ã‚¶ãƒ¼ã®æ®‹é«˜ãŒå‡ºé‡‘最低金é¡ä»¥ä¸‹
+ waiting: 出金待ã¡
+ error: (é€é‡‘失敗)
+ deposits:
+ index:
+ project_deposits: '%{project} é 金'
+ deposits: é 金
+ created_at: ä½œæˆæ—¥
+ project: プãƒã‚¸ã‚§ã‚¯ãƒˆ
+ amount: 金é¡
+ transaction: トランザクション
+ confirmed: 確èª
+ confirmed_yes: '済'
+ confirmed_no: '未'
+ users:
+ index:
+ title: トップコントリビューター
+ name: åå‰
+ commits_count: ãƒãƒƒãƒ—ç·é¡
+ withdrawn: 出金é¡
+ show:
+ balance: 残高
+ threshold: "残高ãŒå‡ºé‡‘å¯èƒ½é¡ã«é”ã™ã‚‹ã¨ãƒãƒƒãƒ—を手ã«ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚"
+ see_all: ã™ã¹ã¦è¦‹ã‚‹
+ received: "%{time} %{project} ã¸ã®è²¢çŒ® %{commit} ã«ã‚ˆã‚Š %{amount} å—é ˜"
+ bitcoin_address_placeholder: ビットコインアドレス
+ notify: æ–°ã—ã„ãƒãƒƒãƒ—ã«ã¤ã„ã¦é€šçŸ¥ã™ã‚‹ï¼ˆæœˆã«ä¸€åº¦ã®ã¿ï¼‰
+ submit_user: ãƒ¦ãƒ¼ã‚¶ãƒ¼æƒ…å ±ã‚’æ›´æ–°ã™ã‚‹
+ change_password: パスワードを変更ã™ã‚‹
+ submit_password: パスワードを変更ã™ã‚‹
+ use_from_gravatar: Gravatarã®ãƒ—ãƒãƒ•ィールを使用ã—ã¾ã™
+ withdrawals:
+ index:
+ title: 最新ã®å‡ºé‡‘
+ created_at: ä½œæˆæ—¥
+ transaction: å–引
+ result: çµæžœ
+ error: 失敗
+ success: æˆåŠŸ
+ devise:
+ sessions:
+ new:
+ title: ãƒã‚°ã‚¤ãƒ³
+ remember_me: 次回ã‹ã‚‰è‡ªå‹•ãƒã‚°ã‚¤ãƒ³ã™ã‚‹
+ submit: ãƒã‚°ã‚¤ãƒ³
+ registrations:
+ new:
+ title: 登録
+ submit: 登録
+ passwords:
+ new:
+ title: パスワードをãŠå¿˜ã‚Œã§ã™ã‹ï¼Ÿ
+ submit: é€ä¿¡ã™ã‚‹
+ edit:
+ title: パスワードを変更ã™ã‚‹
+ submit: 変更
+ confirmations:
+ new:
+ title: èªè¨¼ãƒ¡ãƒ¼ãƒ«ã‚’å†é€ã™ã‚‹
+ submit: é€ä¿¡ã™ã‚‹
+ links:
+ sign_in: ãƒã‚°ã‚¤ãƒ³
+ sign_up: 登録
+ recover: パスワードをãŠå¿˜ã‚Œã§ã™ã‹ï¼Ÿ
+ confirm: èªè¨¼ãƒ¡ãƒ¼ãƒ«ã‚’å—ã‘å–れã¾ã›ã‚“ã§ã—ãŸã‹ï¼Ÿ
+ sign_in_with: "%{provider}ã§ãƒã‚°ã‚¤ãƒ³"
+ errors:
+ primary_email: メールアドレスをèªè¨¼ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™ã€‚
+ onmiauth_info: æƒ…å ±ã‚’å–å¾—ã™ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“ã§ã—ãŸã€‚
+ activerecord:
+ attributes:
+ user:
+ email: メールアドレス
+ bitcoin_address: ビットコインアドレス
+ password: パスワード
+ password_confirmation: パスワード確èª
+ display_name: åå‰
+ omniauth_providers:
+ github: GitHub
+ bitbucket: BitBucket
+ general:
+ or: ã¾ãŸã¯
+ disclaimer:
+ line1: "Tip4Commitã¯ã»ã¨ã‚“ã©ã®ãƒ—ãƒã‚¸ã‚§ã‚¯ãƒˆã‹ã‚‰ã‚¢ãƒ•ィリエイトåŽå…¥ã‚’å¾—ã¦ã„ã¾ã›ã‚“。"
+ line2: "開発者ãŒãƒãƒƒãƒ—ã‚’å¿…ãšè«‹æ±‚ã™ã‚‹ä¿è¨¼ã¯ã‚りã¾ã›ã‚“。"
+ line3: "寄付ã™ã‚‹ã“ã¨ã«ã‚ˆã‚Šã€ãã®è³‡é‡‘をフリーソフトウェア財団ã¾ãŸã¯ä»–ã®å ´æ‰€ã«Tip4Commitã®è£é‡ã§é€é‡‘ã™ã‚‹ã“ã¨ã«åŒæ„ã—ãŸã“ã¨ã«ãªã‚Šã¾ã™ã€‚"
From 801018ae98792e0ee07fc7fc7dfedca9ade14fc1 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sat, 13 Jan 2018 12:26:19 +0100
Subject: [PATCH 017/159] added indonesian and japansese locales
---
app/assets/images/flags/id.png | Bin 0 -> 430 bytes
app/assets/images/flags/ja.png | Bin 0 -> 420 bytes
config/application.rb | 2 +-
3 files changed, 1 insertion(+), 1 deletion(-)
create mode 100644 app/assets/images/flags/id.png
create mode 100644 app/assets/images/flags/ja.png
diff --git a/app/assets/images/flags/id.png b/app/assets/images/flags/id.png
new file mode 100644
index 0000000000000000000000000000000000000000..c6bc0fafac79403c97c64ba0228d35f250d05b57
GIT binary patch
literal 430
zcmV;f0a5;mP)Wr{r~&-|6d^ahvDC!
z|G)qK`}^nrA0Ybu|2K$nd)6X=0AgWa1{?O`IRi-PU$8V7{r&w9sOb0ae<0Pr|Nr{M
zEF}%J0U&@_82&N|Y=e#y>zg27mx!0Xgp5*S}vr
z{r~fq0csvl>92pk!P<5VDfB!NI2#TFQ3lKnzfB%Al=06ZHfFW+c#KiRe{d<4_V)^&)A0s0pNIe5S)eu>r
zF8~6F38(?TQZ#J<0R*xEXct5e0}KG|WIzExE=U%r7$AT^8h-rv@ecwRzz_$3Xaxu`
Y0RLik?wUgPu>b%707*qoM6N<$f;0ZTz5oCK
literal 0
HcmV?d00001
diff --git a/app/assets/images/flags/ja.png b/app/assets/images/flags/ja.png
new file mode 100644
index 0000000000000000000000000000000000000000..325fbad3ffd3075a4a84d8d898ad26ef7d3e0d56
GIT binary patch
literal 420
zcmV;V0bBlwP)9whYk?f=!Q|Ns8||JN@lTD;`{R1ZWk|EGa3dAO8ObDh3E3Cb;oH_5X#1
z|NHy@|M?558b}5Q|Cf`4hZv9q2p|@?lb|{i68>{>{ol0lx`{mi
O0000
Date: Thu, 25 Jan 2018 11:33:08 +0700
Subject: [PATCH 018/159] added malaysia locales
---
config/locales/my.yml | 233 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 233 insertions(+)
create mode 100644 config/locales/my.yml
diff --git a/config/locales/my.yml b/config/locales/my.yml
new file mode 100644
index 00000000..fc2d0ac7
--- /dev/null
+++ b/config/locales/my.yml
@@ -0,0 +1,233 @@
+my:
+ tip4commit: Tip4Commit
+ meta:
+ title: Menyumbang kepada Open Source
+ description: Dermakan bitcoin untuk projek Open Source atau buat komit dan dapatkan tip untuk itu.
+ menu:
+ home: Laman Utama
+ projects: Projek yang disokong
+ footer:
+ text: "Source code boleh didapati di %{github_link} dan anda juga boleh %{support_link} pembangunannya."
+ github_link: GitHub
+ support_link: sokongan
+ follow_link: Ikuti @tip4commit
+ links:
+ sign_up: Daftar
+ sign_in: Masuk
+ sign_in_imp: masuk
+ sign_out: Keluar
+ create_issue: buat satu isu
+ errors:
+ project_not_found: Projek tidak dijumpai.
+ opt_in_notice: "Oleh karana aduan daripada penyelenggara projek, kami tidak menambah projek secara automatik. Projek sedia ada tanpa deposit telah dikeluarkan. Jika anda ingin menambah projek anda, sila %{create_issue_link}."
+ access_denied: Akses dinafikan
+ can_assign_more_tips: "Anda tidak dapat memperuntukkan lebih daripada 100% dana yang tersedia."
+ wrong_bitcoin_address: Ralat mengemas kini alamat bitcoin
+ user_not_found: Pengguna tidak dijumpai
+ access_denied: Anda tidak dibenarkan melaksanakan tindakan ini!
+ notices:
+ project_updated: Tetapan projek telah dikemas kini
+ tips_decided: Jumlah tip telah ditentukan
+ user_updated: Maklumat anda disimpan!
+ user_unsubscribed: "Anda berhenti berlangganan! Maaf kerana mengganggu anda. Walaupun, anda masih boleh meninggalkan alamat bitcoin anda untuk mendapatkan tip anda."
+ tip_amounts:
+ undecided: "Tidak pasti"
+ free: "Percuma: 0%"
+ tiny: "Sangat kecil: 0.1%"
+ small: "Kecil: 0.5%"
+ normal: "Biasa: 1%"
+ big: "Besar: 2%"
+ huge: "Amat besar: 5%"
+ js:
+ errors:
+ value:
+ invalid: Nilai tidak sah
+ email:
+ invalid: Alamat e-mel tidak sah
+ blank: E-mel diperlukan dan tidak boleh kosong
+ password:
+ blank: Kata laluan diperlukan dan tidak boleh kosong
+ invalid: Kata laluan dan pengesahannya tidak sama
+ password_confirmation:
+ blank: Pengesahan kata laluan diperlukan dan tidak boleh kosong
+ invalid: Kata laluan dan pengesahannya tidak sama
+ home:
+ index:
+ see_projects: Lihat projek
+ how_does_it_work:
+ title: Bagaimanakah ia berfungsi?
+ text: Orang ramai menyumbangkan bitcoin kepada projek. Apabila komit seseorang diterima masuk ke repositori projek, kami secara automatik tip pengarang.
+ button: Ketahui mengenai Bitcoin
+ donate:
+ title: Menderma
+ text: Cari projek yang anda suka dan simpan bitcoins ke dalamnya. Derma anda akan terkumpul dengan dana penderma lain untuk diberikan sebagai tip untuk komitmen baru.
+ button: Cari atau tambah projek
+ contribute:
+ title: Sumbang
+ text: Lihat dan perbaiki sesuatu! Sekiranya komit anda diterima oleh penyenggara projek, anda akan mendapat tip!
+ sign_in_text: "Sila periksa e-mel anda untuk jemputan atau %{sign_in_link}."
+ sign_up_text: "Jika anda belum menerima jemputan, anda boleh %{sign_up_link} dengan alamat e-mel yang sah atau melalui"
+ button: Projek yang disokong
+ projects:
+ index:
+ find_project:
+ placeholder: Masukkan URL projek GitHub atau sebarang kata kunci untuk mencari...
+ button: Cari projek
+ repository: Repositori
+ description: Penghuraian
+ watchers: Pemerhati
+ balance: Baki
+ forked_from: dicabut dari
+ support: Sokong projek
+ show:
+ title: "Menyumbang kepada %{project}"
+ fetch_pending: (Menunggu pengambilan awal)
+ edit_project: Tukar tetapan projek
+ decide_tip_amounts: Memutuskan jumlah tip
+ disabled_notifications: "Penyelenggara projek telah memutuskan untuk tidak memberitahu penyumbang baru tentang tip dan mereka mungkin tidak suka cara pembiayaan ini."
+ fee: "%{percentage} dana yang disimpan akan digunakan untuk memberi tip baru."
+ balance: Baki
+ deposits: Menyimpan
+ custom_tip_size: (setiap komit baru menerima peratusan baki yang ada)
+ default_tip_size: "(setiap komit baru menerima %{percentage} daripada baki yang ada)"
+ min_tip_size: "Saiz tip minimum ditetapkan kepada %{min_tip}, tetapi jika baki yang ada kurang dari itu maka ia akan dihantar sebagai tip yang lebih kecil"
+ unconfirmed_amount: "(%{amount} belum disahkan)"
+ tipping_policies: Dasar tip
+ updated_by_user: "(Dikemaskinikan terakhir oleh %{name} pada %{date})"
+ updated_by_unknown: "(Terkini diperbaharui %{date})"
+ tips_paid: Tip Dibayar
+ unclaimed_amount: "(%{amount} daripada ini tidak dituntut, dan akan dikembalikan kepada projek itu selepas tidak dituntut selama 1 bulan.)"
+ last_tips: Tip terakhir
+ see_all: lihat semua
+ received: "menerima %{amount}"
+ will_receive: akan menerima tip
+ for_commit: untuk komit
+ when_decided: apabila amaunnya diputuskan
+ next_tip: Tip seterusnya
+ contribute_and_earn: Sumbang dan Dapatkan
+ contribute_and_earn_description: "Dermakan bitcoins ke projek ini atau %{make_commits_link} dan dapatkan tip untuknya. Sekiranya komit anda diterima %{branch} oleh seorang penyenggara projek dan terdapat bitcoin pada baki, anda akan mendapat tip!"
+ contribute_and_earn_branch: "ke %{branch} branch"
+ make_commits_link: membuat komit
+ tell_us_bitcoin_address: "Sila %{tell_us_link} alamat bitcoin anda."
+ tell_us_link: beritahu kami
+ sign_in: "Sila semak e-mel anda atau %{sign_in_link}."
+ promote_project: Menggalakkan %{project}
+ embedding: Embedding
+ image_url: "URL imej:"
+ shield_title: tip untuk komit seterusnya
+ edit:
+ project_settings: "%{project} tetapan projek"
+ branch: Branch
+ default_branch: Lalai branch
+ tipping_policies: Dasar tip
+ hold_tips: "Jangan hantar tip dengan segera. Beri kolaborator keupayaan untuk mengubahsuai tip sebelum dihantar"
+ save: Simpan tetapan projek
+ disable_notifications: Jangan beritahu penyumbang baru
+ decide_tip_amounts:
+ commit: Komit
+ author: Pengarang
+ message: Mesej
+ tip: Tip (berbanding dengan baki projek)
+ submit: Hantar jumlah tip yang dipilih
+ blacklisted:
+ title: Maaf, projek ini tidak menerima tip!
+ message: Penulis projek ini telah memilih untuk tidak membenarkan tip untuk projek ini.
+ tips:
+ index:
+ tips: Tips
+ project_tips: '%{project} tips'
+ user_tips: "%{user} tips"
+ created_at: Dicipta Pada
+ commiter: Kommiter
+ project: Projek
+ commit: Komit
+ amount: Jumlah
+ refunded: Dibayar balik kepada deposit projek
+ undecided: Jumlah tip belum diputuskan
+ no_bitcoin_address: Pengguna tidak menyatakan alamat pengeluaran
+ below_threshold: "Baki pengguna adalah di bawah ambang pengeluaran"
+ waiting: Menunggu pengeluaran
+ error: (kesilapan menghantar transaksi)
+ deposits:
+ index:
+ project_deposits: '%{project} deposit'
+ deposits: Deposit
+ created_at: Dicipta Pada
+ project: Projek
+ amount: Jumlah
+ transaction: Transaksi
+ confirmed: Dikesahkan
+ confirmed_yes: 'Ya'
+ confirmed_no: 'Tidak'
+ users:
+ index:
+ title: Penyumbang Teratas
+ name: Nama
+ commits_count: Komit telah di tip
+ withdrawn: Ditarik balik
+ show:
+ balance: Baki
+ threshold: "Anda akan mendapat wang anda apabila baki anda mencapai ambang %{threshold}"
+ see_all: lihat semua
+ received: "%{time} menerima %{amount} untuk komit %{commit} dalam %{project}"
+ bitcoin_address_placeholder: Alamat bitcoin anda
+ notify: Beritahu saya tentang tip baru (tidak lebih dari satu e-mel sebulan)
+ submit_user: Kemas kini maklumat pengguna
+ change_password: Tukar kata laluan anda
+ submit_password: Tukar kata laluan saya
+ use_from_gravatar: Gunakan dari profil gravatar anda
+ withdrawals:
+ index:
+ title: Pengeluaran Terakhir
+ created_at: Dicipta Pada
+ transaction: Transaksi
+ result: Keputusan
+ error: Ralat
+ success: Kejayaan
+ devise:
+ sessions:
+ new:
+ title: Masuk
+ remember_me: Ingat saya
+ submit: Masuk
+ registrations:
+ new:
+ title: Daftar
+ submit: Daftar
+ passwords:
+ new:
+ title: Lupa kata laluan anda?
+ submit: Hantar saya menetapkan semula arahan kata laluan
+ edit:
+ title: Tukar kata laluan anda
+ submit: Tukar kata laluan saya
+ confirmations:
+ new:
+ title: Hantar semula arahan pengesahan
+ submit: Hantar semula arahan pengesahan
+ links:
+ sign_in: Masuk
+ sign_up: Daftar
+ recover: Lupa kata laluan anda?
+ confirm: Tidak menerima arahan pengesahan?
+ sign_in_with: "Daftar masuk dengan %{provider}"
+ errors:
+ primary_email: alamat e-mel utama anda perlu disahkan.
+ onmiauth_info: kami tidak dapat mengambil maklumat anda.
+ activerecord:
+ attributes:
+ user:
+ email: E-mel
+ bitcoin_address: Alamat Bitcoin
+ password: Kata laluan
+ password_confirmation: Pengesahan kata laluan
+ display_name: Nama paparan
+ omniauth_providers:
+ github: GitHub
+ bitbucket: BitBucket
+ general:
+ or: atau
+ disclaimer:
+ line1: "Tip4Commit tidak bergabung dengan kebanyakan projek."
+ line2: "Tidak ada jaminan bahawa tip akan dituntut oleh developer."
+ line3: "Dengan menderma dana anda bersetuju bahawa mereka boleh dihantar ke Free Software Foundation atau ke tempat lain atas kebijaksanaan Tip4Commit's."
From 8810de0f616d8f9ded5c3ea95eec6af37133f8a1 Mon Sep 17 00:00:00 2001
From: Joao
Date: Wed, 31 Jan 2018 20:25:27 +0000
Subject: [PATCH 019/159] Added portuguese language
---
README_PT.md | 25 ++++
app/assets/images/flags/pt.png | Bin 0 -> 406 bytes
config/application.rb | 2 +-
config/locales/pt.yml | 233 +++++++++++++++++++++++++++++++++
4 files changed, 259 insertions(+), 1 deletion(-)
create mode 100644 README_PT.md
create mode 100644 app/assets/images/flags/pt.png
create mode 100644 config/locales/pt.yml
diff --git a/README_PT.md b/README_PT.md
new file mode 100644
index 00000000..a07a6089
--- /dev/null
+++ b/README_PT.md
@@ -0,0 +1,25 @@
+Tip4commit
+==========
+
+[](https://tip4commit.com/projects/307)
+[](https://travis-ci.org/tip4commit/tip4commit)
+
+Doe bitcoins para projetos de codigo aberto ou receba gorjetas por colaborar no código.
+
+Nome | Ligação
+----|----|
+Site oficial| https://tip4commit.com/
+Discussões | https://bitcointalk.org/index.php?topic=31580
+FAQs | https://github.com/tip4commit/tip4commit/wiki/FAQ
+Problemas | https://github.com/tip4commit/tip4commit/issues
+
+Colaboradores
+==========
+
+Se quiser contribuir para o desenvolvimento de tip4commit, pode encontrar as regras de colaborações e de instalação em [README para colaboradores](https://github.com/tip4commit/tip4commit/wiki/Developer-README)
+
+
+Licença
+=======
+
+[Licença MIT](https://github.com/tip4commit/tip4commit/blob/master/LICENSE)
diff --git a/app/assets/images/flags/pt.png b/app/assets/images/flags/pt.png
new file mode 100644
index 0000000000000000000000000000000000000000..182c8c837cc47f7925ab34b3f1cc6ea97a91072f
GIT binary patch
literal 406
zcmV;H0crk;P)l7c&>Q$JUsS9ME6TeYNcv>uzT%%PW)qI@eK|AYir@jHOa_S`8++gxGMqFm~OcJR18`%_2yLPGO3DcQn2=Frqhkx4<3G|tFR
z*68~5XH5NYarN8OQ;|jWJU02kQR--Ly!-
zy{^}C4jlwiK}HD1j%`~^-AIbMH;i*31VWV3A1P!SK4;@iSO5S307*qoM6N<$f-69^
A-2eap
literal 0
HcmV?d00001
diff --git a/config/application.rb b/config/application.rb
index 80727a7b..48ab0f09 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -25,7 +25,7 @@ class Application < Rails::Application
config.autoload_paths += %W[#{config.root}/lib]
config.assets.initialize_on_precompile = true
- config.available_locales = %w[en es fr nl ru pl hr de ro ko id ja]
+ config.available_locales = %w[en es fr nl ru pl hr de ro ko id ja pt]
config.active_job.queue_adapter = :sidekiq
end
end
diff --git a/config/locales/pt.yml b/config/locales/pt.yml
new file mode 100644
index 00000000..560fa282
--- /dev/null
+++ b/config/locales/pt.yml
@@ -0,0 +1,233 @@
+en:
+ tip4commit: Tip4Commit
+ meta:
+ title: Colabora para Código Aberto
+ description: Doa bitcoins para projetos de código aberto ou faça commits e receba gorjetas por eles.
+ menu:
+ home: Inicio
+ projects: Projetos suportados
+ footer:
+ text: "Código fonte está disponÃvel em %{github_link} e também pode %{support_link} o seu desenvolvimento."
+ github_link: GitHub
+ support_link: suporte
+ follow_link: Siga @tip4commit
+ links:
+ sign_up: Registar
+ sign_in: Entrar
+ sign_in_imp: entrar
+ sign_out: Sair
+ create_issue: criar um problema
+ errors:
+ project_not_found: Projeto não encontrado.
+ opt_in_notice: "Devido a queixas de gestores dos projetos, nós não adicionamos mais projetos automaticamente. Projetos existentes sem depósitos foram removidos. Se quiser adicionar o seu projeto, por favor %{create_issue_link}."
+ access_denied: Acesso negado
+ can_assign_more_tips: "Não pode assignar mais de 100% dos fundos disponÃveis."
+ wrong_bitcoin_address: Erro atualizando endereço de bitcoin
+ user_not_found: Utilizador não encontrado
+ access_denied: Não está autorizado a realizar essa operação!
+ notices:
+ project_updated: As configurações do projeto foram atualizadas
+ tips_decided: As quantidades das gorjetas foram definidas
+ user_updated: A sua informação foi gravada!
+ user_unsubscribed: "Desinscreveu-se! Pedimos desculpa pelo aborrecimento. No entanto, pode sempre nos deixar o seu endereço de bitcoin address para receber as suas gorjetas."
+ tip_amounts:
+ undecided: "Indeciso"
+ free: "Gratis: 0%"
+ tiny: "Diminuto: 0.1%"
+ small: "Pequeno: 0.5%"
+ normal: "Normal: 1%"
+ big: "Grande: 2%"
+ huge: "Enorme: 5%"
+ js:
+ errors:
+ value:
+ invalid: Valor é invalido
+ email:
+ invalid: Endereço de Email inválido
+ blank: O Email é necessário e não pode ser vazio
+ password:
+ blank: A senha é necessária e não pode ser vazia
+ invalid: A senha e a sua confirmação não são iguais
+ password_confirmation:
+ blank: A confirmação da senha é necessária e não pode ser vazia
+ invalid: A senha e a sua confirmação não são iguais
+ home:
+ index:
+ see_projects: Ver projetos
+ how_does_it_work:
+ title: Como funciona?
+ text: Pessoas doam bitcoins para os projetos. Quando o commit é aceite no repositório do projeto, nós automaticamente damos uma gorjeta ao autor.
+ button: Aprenda sobre Bitcoin
+ donate:
+ title: Doe
+ text: Encontre um projeto que goste e deposite bitcoins nele. A sua doação será acumulada com os fundos de outros doadores para serem dadas em novos commits.
+ button: Encontre ou adicione um projeto
+ contribute:
+ title: Colabore
+ text: Vá e concerte algo! Quando o seu commit fore aceite pelo gestor do projeto, voce recebe a gorjeta!
+ sign_in_text: "Verifique o seu email por um convite ou %{sign_in_link}."
+ sign_up_text: "Se ainda não recebeu um convite, pode %{sign_up_link} com um endereço de email válido ou via"
+ button: Projetos suportados
+ projects:
+ index:
+ find_project:
+ placeholder: Introduza URL de projeto GitHub or qualquer palavra-chave para o encontrar...
+ button: Encontrar projeto
+ repository: Repositório
+ description: Descrição
+ watchers: Observadores
+ balance: Saldo
+ forked_from: Copiado de
+ support: Suportar projeto
+ show:
+ title: "Colabore para %{project}"
+ fetch_pending: (Busca inicial pendente)
+ edit_project: Alterar configurações do projeto
+ decide_tip_amounts: Definir quantidades de gorjetas
+ disabled_notifications: "Os gestores dos projetos decidiram não notificar os novos colaboradores sobre as gorjetas e provavelmente não gostam desta forma de financiamento."
+ fee: "%{percentage} de fundos depositados que serão usados para gratificar novos commits."
+ balance: Saldo
+ deposits: depositos
+ custom_tip_size: (cada novo commit recebe uma percentagem do saldo disponÃvel)
+ default_tip_size: "(cada novo commit recebe %{percentage} do saldo disponÃvel)"
+ min_tip_size: "A quantidade minima da gorjeta foi definida para %{min_tip}, mas se o saldo disponÃvel for menos que isso então será enviada uma gorjeta menor"
+ unconfirmed_amount: "(%{amount} não confirmada)"
+ tipping_policies: PolÃticas de gorjetas
+ updated_by_user: "(Ultima atualização de %{name} em %{date})"
+ updated_by_unknown: "(Ultima atualização em %{date})"
+ tips_paid: Gorjetas pagas
+ unclaimed_amount: "(%{amount} disto não foi reclamado, e será devolvido ao projeto se não for reclamado por 1 mês.)"
+ last_tips: Ultimas gorjetas
+ see_all: ver todas
+ received: "recebido %{amount}"
+ will_receive: irá receber gorjeta
+ for_commit: por commit
+ when_decided: quando a quantidade for decidida
+ next_tip: Próxima gorjeta
+ contribute_and_earn: Colabore e ganhe
+ contribute_and_earn_description: "Doe bitcoins para esta projeto ou %{make_commits_link} e receba gorjetas por ele. Se o seu commit for aceite %{branch} por um gestor do projeto e houver bitcoins no seu saldo, receberá uma gorjeta!"
+ contribute_and_earn_branch: "para %{branch} branch"
+ make_commits_link: fazer commits
+ tell_us_bitcoin_address: "Apenas %{tell_us_link} o seu endereço de bitcoin."
+ tell_us_link: Diga-nos
+ sign_in: "Verifique o seu email ou %{sign_in_link}."
+ promote_project: Promova %{project}
+ embedding: Incorporação
+ image_url: "Imagem do URL:"
+ shield_title: Dê uma gorjeta para o proximo commit
+ edit:
+ project_settings: "%{project} configurações do projeto"
+ branch: Branch
+ default_branch: Branch por omissão
+ tipping_policies: PolÃticas de gorjetas
+ hold_tips: "Não enviar as gorjetas imediatamente. Dar aos colaboradores a possibilidade de modificar as gorjetas antes de serem enviadas"
+ save: Gravar as configurações do projeto
+ disable_notifications: Não notificar novos colaboradores
+ decide_tip_amounts:
+ commit: Commit
+ author: Autor
+ message: Mensagem
+ tip: Gorjeta (relativa ao saldo do projeto)
+ submit: Envie as quantidades selecionadas de gorjetas
+ blacklisted:
+ title: As nossas desculpas, este projeto nao aceita gorjetas!
+ message: O autor deste projeto decidiu desabilitar as gorjetas para este projeto.
+ tips:
+ index:
+ tips: Gorjetas
+ project_tips: '%{project} gorjetas'
+ user_tips: "%{user} gorjetas"
+ created_at: Criado em
+ commiter: Commiter
+ project: Projeto
+ commit: Commit
+ amount: Quantidade
+ refunded: Devolvido ao saldo do projeto
+ undecided: A quantidade da gorjeta ainda não foi decidida
+ no_bitcoin_address: O utilizador ainda nao especificou o endereço de levantamento
+ below_threshold: "O saldo do utilizador é menor que mÃnimo para levantar"
+ waiting: À espera de levantamento
+ error: (erro a enviar a transação)
+ deposits:
+ index:
+ project_deposits: '%{project} depósitos'
+ deposits: Depósitos
+ created_at: Criado em
+ project: Projeto
+ amount: Quantidade
+ transaction: Transação
+ confirmed: Confirmado
+ confirmed_yes: 'Sim'
+ confirmed_no: 'Não'
+ users:
+ index:
+ title: Top Colaboradores
+ name: Nome
+ commits_count: Commits gratificados
+ withdrawn: Levantados
+ show:
+ balance: Saldo
+ threshold: "Receberá o seu dinheiro quando o saldo chegar a %{threshold}"
+ see_all: ver todos
+ received: "%{time} recebido %{amount} por commit %{commit} em %{project}"
+ bitcoin_address_placeholder: Seu endereço bitcoin
+ notify: Notificar-me de novas gorjetas (não mais que um email por mês)
+ submit_user: Atualizar informação de utilizador
+ change_password: Mudar a sua senha
+ submit_password: Mudar a minha senha
+ use_from_gravatar: Utilizar do seu perfil gravatar
+ withdrawals:
+ index:
+ title: Últimos Levantamentos
+ created_at: Criado em
+ transaction: Transação
+ result: Resultado
+ error: Erro
+ success: Sucesso
+ devise:
+ sessions:
+ new:
+ title: Entrar
+ remember_me: Lembrar-me
+ submit: Entrar
+ registrations:
+ new:
+ title: Registar
+ submit: Registar
+ passwords:
+ new:
+ title: Esqueceu-se da sua senha?
+ submit: Enviar-me instruções para repor a senha
+ edit:
+ title: Mudar a sua senha
+ submit: Mudar a minha senha
+ confirmations:
+ new:
+ title: Reenviar instruções de confirmação
+ submit: Reenviar instruções de confirmação
+ links:
+ sign_in: Entrar
+ sign_up: Registar
+ recover: Esqueceu-se da sua senha?
+ confirm: Não recebeu instruções de confirmação?
+ sign_in_with: "Entrar com %{provider}"
+ errors:
+ primary_email: o seu endereço primário deve ser verificado.
+ onmiauth_info: não foi possÃvel buscar a sua informação.
+ activerecord:
+ attributes:
+ user:
+ email: E-mail
+ bitcoin_address: Endereço bitcoin
+ password: senha
+ password_confirmation: Confirmação de senha
+ display_name: Nome de exibição
+ omniauth_providers:
+ github: GitHub
+ bitbucket: BitBucket
+ general:
+ or: ou
+ disclaimer:
+ line1: "Tip4Commit não está afiliado com a maior parte dos projetos."
+ line2: "Não há garantia que as gorjetas serão reclamados pelos colaboradores."
+ line3: "Ao doar os fundos concorda que poderão ser enviados para a Free Software Foundation ou para qualquer outro lado ao critério da Tip4Commit."
From 47b0ac2390ba610bfd95bdfa884f137629337991 Mon Sep 17 00:00:00 2001
From: Joao
Date: Wed, 31 Jan 2018 22:01:31 +0000
Subject: [PATCH 020/159] Minor fixes
---
README_PT.md | 2 +-
config/application.rb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/README_PT.md b/README_PT.md
index a07a6089..b285827e 100644
--- a/README_PT.md
+++ b/README_PT.md
@@ -4,7 +4,7 @@ Tip4commit
[](https://tip4commit.com/projects/307)
[](https://travis-ci.org/tip4commit/tip4commit)
-Doe bitcoins para projetos de codigo aberto ou receba gorjetas por colaborar no código.
+Doe bitcoins para projetos de código aberto ou receba gorjetas por colaborar no código.
Nome | Ligação
----|----|
diff --git a/config/application.rb b/config/application.rb
index 48ab0f09..0d627756 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -25,7 +25,7 @@ class Application < Rails::Application
config.autoload_paths += %W[#{config.root}/lib]
config.assets.initialize_on_precompile = true
- config.available_locales = %w[en es fr nl ru pl hr de ro ko id ja pt]
+ config.available_locales = %w[en es fr pt nl ru pl hr de ro ko id ja]
config.active_job.queue_adapter = :sidekiq
end
end
From db8514b9f2a4f28361b656cccb7372533aedf354 Mon Sep 17 00:00:00 2001
From: Joao
Date: Wed, 31 Jan 2018 22:14:48 +0000
Subject: [PATCH 021/159] removed from application.rb for testing
---
config/application.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/application.rb b/config/application.rb
index 0d627756..80727a7b 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -25,7 +25,7 @@ class Application < Rails::Application
config.autoload_paths += %W[#{config.root}/lib]
config.assets.initialize_on_precompile = true
- config.available_locales = %w[en es fr pt nl ru pl hr de ro ko id ja]
+ config.available_locales = %w[en es fr nl ru pl hr de ro ko id ja]
config.active_job.queue_adapter = :sidekiq
end
end
From 06a0ea9d6e0159b6ec8d1d87e71d983cdc487df9 Mon Sep 17 00:00:00 2001
From: Joao
Date: Wed, 31 Jan 2018 22:28:11 +0000
Subject: [PATCH 022/159] fix
---
config/application.rb | 2 +-
config/locales/pt.yml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/config/application.rb b/config/application.rb
index 80727a7b..48ab0f09 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -25,7 +25,7 @@ class Application < Rails::Application
config.autoload_paths += %W[#{config.root}/lib]
config.assets.initialize_on_precompile = true
- config.available_locales = %w[en es fr nl ru pl hr de ro ko id ja]
+ config.available_locales = %w[en es fr nl ru pl hr de ro ko id ja pt]
config.active_job.queue_adapter = :sidekiq
end
end
diff --git a/config/locales/pt.yml b/config/locales/pt.yml
index 560fa282..0ea07ff8 100644
--- a/config/locales/pt.yml
+++ b/config/locales/pt.yml
@@ -1,4 +1,4 @@
-en:
+pt:
tip4commit: Tip4Commit
meta:
title: Colabora para Código Aberto
From 63f3398a2a3a3a8078e63e0b1294c0e6676b9254 Mon Sep 17 00:00:00 2001
From: Humz
Date: Sat, 10 Mar 2018 13:25:20 +0000
Subject: [PATCH 023/159] Updated License year to 2018
---
LICENSE | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/LICENSE b/LICENSE
index 01081a42..62c97553 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (c) 2017 tip4commit
+Copyright (c) 2018 tip4commit
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
From e5516aec68c25876b2b7cf0406bf09e627598481 Mon Sep 17 00:00:00 2001
From: dengshen
Date: Thu, 5 Apr 2018 18:43:19 +0800
Subject: [PATCH 024/159] add simplified chinese for the people's republic of
China and traditional chinese for Hong Kong
---
app/assets/images/flags/cn.png | Bin 0 -> 538 bytes
app/assets/images/flags/hk.png | Bin 0 -> 589 bytes
config/application.rb | 2 +-
config/locales/cn.yml | 233 +++++++++++++++++++++++++++++++++
config/locales/hk.yml | 233 +++++++++++++++++++++++++++++++++
5 files changed, 467 insertions(+), 1 deletion(-)
create mode 100755 app/assets/images/flags/cn.png
create mode 100755 app/assets/images/flags/hk.png
create mode 100644 config/locales/cn.yml
create mode 100644 config/locales/hk.yml
diff --git a/app/assets/images/flags/cn.png b/app/assets/images/flags/cn.png
new file mode 100755
index 0000000000000000000000000000000000000000..73e54843a8a515b7c65a31ada3a94f73804176c4
GIT binary patch
literal 538
zcmV+#0_FXQP)Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^RV0|O8{6=yBzbN~PV8FWQhbVF}#
zZDnqB07G(RVRU6=Aa`kWXdp*PO;A^X4i^9b0f$LMK~yNuosvCn6hRP$zxtUOuXlwJ
zWL$s%i3}1Xgt!1)00(dg4#1&+fC~^3k`ds@32U>v!|v20=<%AElB!GHPxY!_RoREP
z=MM+B0Rd(}fecI_W-GwjU1}J{D2?{*#iO5Ro2v&*4X8aVpN?$4=1fv8NkVgMUaXgA
z7p}-1t7P?BuuAMS*nVGd@&w8|DtnY2)%B1an!U28B6n^cSeM*;bKw5F15!tg$)6ts
z)&-scnV1KPglz7aScD}JXxDM^{w_Wg);ZdW<+B~@PaU#ql3kc;mH{e3BuNBhFkLza
z2@rQ)jjTVO;{Ctc3(1c?a4#%^v5_hs>!lQ%klD(y^C0`@V;-=rs+5`c_X!Iq$VNvwjL4W;rA8W>t79YCr%c4
z-(!7`MdI$5ds`*5MqCqAG5KBzoEY;KN=(}g({|IO95+$N({7$H#?{%7pC3PeIhYOn
chmF$s7ogza=@FoGf&c&j07*qoM6N<$f@Z$mM*si-
literal 0
HcmV?d00001
diff --git a/app/assets/images/flags/hk.png b/app/assets/images/flags/hk.png
new file mode 100755
index 0000000000000000000000000000000000000000..cb23585b37c02364c35f97cebb9384536becaa10
GIT binary patch
literal 589
zcmV-T0Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^RV0|OBT5AkI)hX4Qo8FWQhbVF}#
zZDnqB07G(RVRU6=Aa`kWXdp*PO;A^X4i^9b0lG;#;_~wnHO}8cj%zy$IAP}|Hm;eb(fH9PY_WsQAFO&Tr`;b6F
zb=>yCzq!I{XYy+*a!|6dMVJa8RD?D+p@3zD5LU`o5lNKDL7E31IVPyPlmcag-S-|*
z27OjuJjDbuucZl>un2P^AQLh%4-9A>o5k7_bkAQUrgkxPYo5mR44#2SV3EiZB1xhK
zCFBk&?3{l{Lv`(I4@y->97*F5@i@+@cB2gxmiMQH(yMLF#y9F8t
z4w3t(=`Xxt@%AOWYGN_Ir))q3PQ*Ad66&!=YpdkU5qcM{VXZdZb93PKhgA2(A}xnY
zOKiA^P8Y8#P$4He^k2VZ`PoB$e)_xY#aW>){w2ufk4n)sYR%c!?dVzl08wBG+~6SZ~PZwO=9oowc-+0$p6W=;OX
bhSKmCG?u%{branch} 分支"
+ make_commits_link: æäº¤ä»£ç
+ tell_us_bitcoin_address: "请 %{tell_us_link} 您的比特å¸åœ°å€ã€‚"
+ tell_us_link: 告诉我们
+ sign_in: "请告诉我们您的电åé‚®ç®±åœ°å€æˆ– %{sign_in_link}."
+ promote_project: 推广 %{project}
+ embedding: 嵌入
+ image_url: "图片地å€:"
+ shield_title: 打èµä¸‹ä¸€ä¸ªä»£ç æäº¤
+ edit:
+ project_settings: "%{project} 项目设置"
+ branch: 分支
+ default_branch: 默认分支
+ tipping_policies: 打èµè§„则
+ hold_tips: "ä¸è¦ç«‹å³å‘逿‰“èµã€‚让其他å作者å¯ä»¥åœ¨å‘é€å‰ä¿®æ”¹æ‰“èµé‡‘é¢"
+ save: ä¿å˜é¡¹ç›®è®¾ç½®
+ disable_notifications: ä¸è¦é€šçŸ¥æ–°çš„贡献值
+ decide_tip_amounts:
+ commit: ä»£ç æäº¤
+ author: 作者
+ message: 消æ¯
+ tip: æ‰“èµ (和项目资金平衡相关)
+ submit: å‘é€å·²é€‰å®šçš„æ‰“èµé‡‘é¢
+ blacklisted:
+ title: 抱æ‰ï¼Œè¿™ä¸ªé¡¹ç›®ä¸æŽ¥å—打èµï¼
+ message: è¿™ä¸ªé¡¹ç›®çš„ä½œè€…é€‰æ‹©ç¦æ¢é¡¹ç›®æ‰“èµã€‚
+ tips:
+ index:
+ tips: 打èµ
+ project_tips: '%{project} 打èµ'
+ user_tips: "%{user} 打èµ"
+ created_at: 创建于
+ commiter: ä»£ç æäº¤è€…
+ project: 项目
+ commit: ä»£ç æäº¤
+ amount: æ•°é¢
+ refunded: æèµ ç»™äº†é¡¹ç›®å˜æ¬¾
+ undecided: 该打èµé‡‘é¢è¿˜æœªç¡®å®š
+ no_bitcoin_address: 用户没有指定退款地å€
+ below_threshold: "用户的资金平衡低于退款门槛"
+ waiting: ç‰å¾…退款
+ error: (å‘é€äº¤æ˜“错误)
+ deposits:
+ index:
+ project_deposits: '%{project} å˜æ¬¾'
+ deposits: å˜æ¬¾
+ created_at: 创建于
+ project: 项目
+ amount: æ•°é¢
+ transaction: 交易
+ confirmed: 已确认
+ confirmed_yes: '是'
+ confirmed_no: 'å¦'
+ users:
+ index:
+ title: 最高贡献者
+ name: åå—
+ commits_count: 已打èµçš„ä»£ç æäº¤
+ withdrawn: 已退款
+ show:
+ balance: 资金平衡
+ threshold: "您将收到您的钱,当您的资金平衡达到门槛 %{threshold} 的时候"
+ see_all: 查看所有
+ received: "%{time} 收到了 %{amount} å› ä¸ºä»£ç æäº¤ %{commit} 在 %{project}"
+ bitcoin_address_placeholder: 您的比特å¸åœ°å€
+ notify: é€šçŸ¥æˆ‘æ–°çš„æ‰“èµ (æ¯ä¸ªæœˆä¸å¤šäºŽä¸€å°é‚®ä»¶)
+ submit_user: 更新用户信æ¯
+ change_password: 更改您的密ç
+ submit_password: 更改密ç
+ use_from_gravatar: 使用您的gravatar账户
+ withdrawals:
+ index:
+ title: 最åŽçš„退款
+ created_at: 创建于
+ transaction: 交易
+ result: 结果
+ error: 错误
+ success: æˆåŠŸ
+ devise:
+ sessions:
+ new:
+ title: 登录
+ remember_me: è®°ä½æˆ‘
+ submit: 登录
+ registrations:
+ new:
+ title: 注册
+ submit: 注册
+ passwords:
+ new:
+ title: 忘记您的密ç ?
+ submit: 给我å‘é€é‡è®¾å¯†ç 的指引
+ edit:
+ title: 更改您的密ç
+ submit: 更改密ç
+ confirmations:
+ new:
+ title: 釿–°å‘é€ç¡®è®¤æŒ‡å¼•
+ submit: 釿–°å‘é€ç¡®è®¤æŒ‡å¼•
+ links:
+ sign_in: 登录
+ sign_up: 注册
+ recover: 忘记您的密ç ?
+ confirm: 没有收到确认指引?
+ sign_in_with: "用 %{provider}登录"
+ errors:
+ primary_email: 您需è¦ç¡®è®¤ä¸»è¦é‚®ç®±åœ°å€
+ onmiauth_info: 我们未æˆåŠŸèŽ·å–æ‚¨çš„ä¿¡æ¯
+ activerecord:
+ attributes:
+ user:
+ email: 电å邮箱
+ bitcoin_address: 比特å¸åœ°å€
+ password: 密ç
+ password_confirmation: 确认密ç
+ display_name: 显示åç§°
+ omniauth_providers:
+ github: GitHub
+ bitbucket: BitBucket
+ general:
+ or: 或者
+ disclaimer:
+ line1: "Tip4Commit ä¸éš¶å±žäºŽå¤§å¤šæ•°é¡¹ç›®ã€‚"
+ line2: "ä¸ä¿è¯å¼€å‘äººå‘˜å°†æŽ¥å—æ‰“èµã€‚"
+ line3: "æèµ å³ä»£è¡¨æ‚¨åŒæ„这些金é¢å¯ä»¥è¢«å‘é€ç»™å…±äº«è½¯ä»¶è”盟或其他Tip4Commitè£å®šçš„地方。"
diff --git a/config/locales/hk.yml b/config/locales/hk.yml
new file mode 100644
index 00000000..1f5e0b1d
--- /dev/null
+++ b/config/locales/hk.yml
@@ -0,0 +1,233 @@
+en:
+ tip4commit: Tip4Commit
+ meta:
+ title: 為開æºåšè²¢ç»
+ description: 給開æºé …ç›®æç»æ¯”ç‰¹å¹£æˆ–è€…é€šéŽæäº¤ä»£ç¢¼ç²å¾—打賞。
+ menu:
+ home: 主é
+ projects: 支æŒçš„é …ç›®
+ footer:
+ text: "您å¯ä»¥åœ¨ %{github_link} 查看æºä»£ç¢¼ï¼Œæˆ–者 %{support_link} é€™å€‹é …ç›®çš„é–‹ç™¼."
+ github_link: GitHub
+ support_link: 支æŒ
+ follow_link: 關註 @tip4commit
+ links:
+ sign_up: 註冊
+ sign_in: 登錄
+ sign_in_imp: 登錄
+ sign_out: 註冊
+ create_issue: 創建壹個å•題
+ errors:
+ project_not_found: é …ç›®æœªæ‰¾åˆ°ã€‚
+ opt_in_notice: "ç”±æ–¼é …ç›®ç¶è·è€…的投訴,我們ä¸å†è‡ªå‹•æ·»åŠ é …ç›®ã€‚æ²’æœ‰å˜æ¬¾çš„ç¾å˜é …ç›®å·²ç¶“è¢«ç§»é™¤ã€‚å¦‚æžœæ‚¨æƒ³æ·»åŠ æ‚¨çš„é …ç›®ï¼Œè«‹ %{create_issue_link}."
+ access_denied: 拒絕訪å•
+ can_assign_more_tips: "您ä¸èƒ½åˆ†é…è¶…éŽ 100% çš„å¯ç”¨è³‡é‡‘。"
+ wrong_bitcoin_address: 更新比特幣地å€å‡ºéŒ¯
+ user_not_found: 未找到用戶
+ access_denied: 您ä¸è¢«å…è¨±åŸ·è¡Œæ¤æ“作ï¼
+ notices:
+ project_updated: é …ç›®è¨ç½®å·²ç¶“æ›´æ–°
+ tips_decided: 打賞總é¡å·²ç¶“æˆåŠŸå®šç¾©
+ user_updated: 您的信æ¯å·²ä¿å˜!
+ user_unsubscribed: "您已æˆåŠŸè¨»éŠ·ï¼æŠ±æ‰çµ¦æ‚¨å¸¶ä¾†å›°æ“¾ã€‚然而,您ä»ç„¶å¯ä»¥çµ¦æˆ‘們留下您的比特幣地å€ä»¥ç²å¾—您的打賞。"
+ tip_amounts:
+ undecided: "未決定"
+ free: "å…è²»: 0%"
+ tiny: "å¾®å°: 0.1%"
+ small: "åå°: 0.5%"
+ normal: "ä¸ç‰: 1%"
+ big: "å大: 2%"
+ huge: "巨大: 5%"
+ js:
+ errors:
+ value:
+ invalid: 數值無效
+ email:
+ invalid: 無效電å郵箱地å€
+ blank: é›»å郵箱地å€ç‚ºå¿…填且ä¸èƒ½ç‚ºç©º
+ password:
+ blank: 密碼為必填且ä¸èƒ½ç‚ºç©º
+ invalid: 密碼和確èªå¯†ç¢¼ä¸ç›¸åŒ
+ password_confirmation:
+ blank: 確èªå¯†ç¢¼ç‚ºå¿…填且ä¸èƒ½ç‚ºç©º
+ invalid: 密碼和確èªå¯†ç¢¼ä¸ç›¸åŒ
+ home:
+ index:
+ see_projects: æŸ¥çœ‹é …ç›®
+ how_does_it_work:
+ title: 它如何é‹è¡Œ?
+ text: äººå€‘çµ¦é …ç›®æè´ˆæ¯”特幣。當有人æäº¤æ–°çš„代碼並被接ç´åˆ°é …目倉庫,我們將自動打賞æäº¤çš„作者。
+ button: 了解更多關於比特幣的知è˜
+ donate:
+ title: æè´ˆ
+ text: 找到壹個您喜æ¡çš„é …ç›®ä¸¦å˜å…¥æ¯”特幣。您的æè´ˆå°‡å’Œå…¶ä»–æè´ˆè€…的金é¡å£¹èµ·ç´¯ç©èµ·ä¾†ç”¨æ–¼æ‰“賞給新的代碼æäº¤ã€‚
+ button: æŸ¥æ‰¾æˆ–æ·»åŠ é …ç›®
+ contribute:
+ title: è²¢ç»
+ text: 去修復壹些å•題å§ï¼å¦‚果您的æäº¤è¢«é …ç›®ç¶è·è€…接å—,您將得到打賞ï¼
+ sign_in_text: "請查收您的邀請郵件或者 %{sign_in_link}."
+ sign_up_text: "如果您還未收到邀請,您å¯ä»¥é€šéŽæœ‰æ•ˆçš„éƒµç®±åœ°å€ %{sign_up_link} 或者通éŽ"
+ button: 支æŒçš„é …ç›®
+ projects:
+ index:
+ find_project:
+ placeholder: 輸入GitHubé …ç›®åœ°å€æˆ–者任æ„é—œéµè©žä¾†æŸ¥æ‰¾...
+ button: æŸ¥æ‰¾é …ç›®
+ repository: 倉庫
+ description: æè¿°
+ watchers: 觀察者
+ balance: 資金平衡
+ forked_from: 分岔自
+ support: 支æŒé …ç›®
+ show:
+ title: "è²¢ç»çµ¦ %{project}"
+ fetch_pending: (未完æˆçš„åˆå§‹æ‹‰å–)
+ edit_project: ä¿®æ”¹é …ç›®è¨ç½®
+ decide_tip_amounts: 決定打賞金é¡
+ disabled_notifications: "é …ç›®ç¶è·è€…決定ä¸å†æé†’新的貢ç»è€…關於打賞的事情而且他們å¯èƒ½ä¸å–œæ¡é€™ç¨®æ–¹å¼çš„籌資。"
+ fee: "%{percentage} çš„å˜æ¬¾ä½™é¡å°‡è¢«ç”¨æ–¼æ‰“賞新的代碼æäº¤ã€‚"
+ balance: 資金平衡
+ deposits: å˜æ¬¾
+ custom_tip_size: (æ¯å€‹æ–°æäº¤å°‡æ”¶åˆ°éƒ¨åˆ†ç™¾åˆ†æ¯”çš„å¯ç”¨ä½™é¡)
+ default_tip_size: "(æ¯å€‹æ–°æäº¤å°‡æ”¶åˆ° %{percentage} çš„å¯ç”¨ä½™é¡)"
+ min_tip_size: "æœ€å°æ‰“賞金é¡è¢«è¨ç‚º %{min_tip},但如果å¯ç”¨ä½™é¡å°æ–¼æœ€å°æ‰“è³žå®ƒå°‡è¢«ç•¶ä½œå£¹ç†æ›´å°çš„æ‰“賞發é€"
+ unconfirmed_amount: "(%{amount} 未確定)"
+ tipping_policies: 打賞è¦å‰‡
+ updated_by_user: "(上壹次更新由 %{name} 於 %{date})"
+ updated_by_unknown: "(上壹次更新於 %{date})"
+ tips_paid: 已支付打賞
+ unclaimed_amount: "(%{amount} 無人èªé ˜ï¼Œå¦‚果壹個月後ä»ç„¶ç„¡äººèªé ˜è©²ç†é‡‘é¡å°‡è¢«é€€å›žçµ¦é€™å€‹é …ç›®)"
+ last_tips: 最新打賞
+ see_all: 查看所有
+ received: "收到 %{amount}"
+ will_receive: 將接收壹次打賞
+ for_commit: 給代碼æäº¤
+ when_decided: 當它的金é¡è¢«ç¢ºå®š
+ next_tip: 下壹次打賞
+ contribute_and_earn: è²¢ç»è€Œç²å–收益
+ contribute_and_earn_description: "æè´ˆæ¯”ç‰¹å¹£çµ¦é€™å€‹é …ç›®æˆ–è€… %{make_commits_link} 來ç²å¾—打賞。如果您的代碼æäº¤è¢«æŽ¥ç´ %{branch} å¾—åˆ°é …ç›®ç¶è·è€…èªå¯è€Œä¸”é …ç›®æœ‰æ¯”ç‰¹å¹£ä½™é¡ï¼Œæ‚¨å°‡ç²å¾—çŽè³ž"
+ contribute_and_earn_branch: "給 %{branch} 分支"
+ make_commits_link: æäº¤ä»£ç¢¼
+ tell_us_bitcoin_address: "è«‹ %{tell_us_link} 您的比特幣地å€ã€‚"
+ tell_us_link: 告訴我們
+ sign_in: "請告訴我們您的電åéƒµç®±åœ°å€æˆ– %{sign_in_link}."
+ promote_project: 推廣 %{project}
+ embedding: 嵌入
+ image_url: "圖片地å€:"
+ shield_title: 打賞下壹個代碼æäº¤
+ edit:
+ project_settings: "%{project} é …ç›®è¨ç½®"
+ branch: 分支
+ default_branch: 默èªåˆ†æ”¯
+ tipping_policies: 打賞è¦å‰‡
+ hold_tips: "ä¸è¦ç«‹å³ç™¼é€æ‰“賞。讓其他å”作者å¯ä»¥åœ¨ç™¼é€å‰ä¿®æ”¹æ‰“賞金é¡"
+ save: ä¿å˜é …ç›®è¨ç½®
+ disable_notifications: ä¸è¦é€šçŸ¥æ–°çš„è²¢ç»å€¼
+ decide_tip_amounts:
+ commit: 代碼æäº¤
+ author: 作者
+ message: 消æ¯
+ tip: 打賞 (å’Œé …ç›®è³‡é‡‘å¹³è¡¡ç›¸é—œ)
+ submit: 發é€å·²é¸å®šçš„æ‰“賞金é¡
+ blacklisted:
+ title: 抱æ‰ï¼Œé€™å€‹é …ç›®ä¸æŽ¥å—æ‰“賞ï¼
+ message: é€™å€‹é …ç›®çš„ä½œè€…é¸æ“‡ç¦æ¢é …目打賞。
+ tips:
+ index:
+ tips: 打賞
+ project_tips: '%{project} 打賞'
+ user_tips: "%{user} 打賞"
+ created_at: 創建於
+ commiter: 代碼æäº¤è€…
+ project: é …ç›®
+ commit: 代碼æäº¤
+ amount: 數é¡
+ refunded: æè´ˆçµ¦äº†é …ç›®å˜æ¬¾
+ undecided: 該打賞金é¡é‚„未確定
+ no_bitcoin_address: 用戶沒有指定退款地å€
+ below_threshold: "用戶的資金平衡低於退款門檻"
+ waiting: ç‰å¾…退款
+ error: (發é€äº¤æ˜“錯誤)
+ deposits:
+ index:
+ project_deposits: '%{project} å˜æ¬¾'
+ deposits: å˜æ¬¾
+ created_at: 創建於
+ project: é …ç›®
+ amount: 數é¡
+ transaction: 交易
+ confirmed: 已確èª
+ confirmed_yes: '是'
+ confirmed_no: 'å¦'
+ users:
+ index:
+ title: 最高貢ç»è€…
+ name: åå—
+ commits_count: 已打賞的代碼æäº¤
+ withdrawn: 已退款
+ show:
+ balance: 資金平衡
+ threshold: "您將收到您的錢,當您的資金平衡é”到門檻 %{threshold} 的時候"
+ see_all: 查看所有
+ received: "%{time} 收到了 %{amount} å› ç‚ºä»£ç¢¼æäº¤ %{commit} 在 %{project}"
+ bitcoin_address_placeholder: 您的比特幣地å€
+ notify: 通知我新的打賞 (æ¯å€‹æœˆä¸å¤šæ–¼å£¹å°éƒµä»¶)
+ submit_user: 更新用戶信æ¯
+ change_password: 更改您的密碼
+ submit_password: 更改密碼
+ use_from_gravatar: 使用您的gravatar賬戶
+ withdrawals:
+ index:
+ title: 最後的退款
+ created_at: 創建於
+ transaction: 交易
+ result: çµæžœ
+ error: 錯誤
+ success: æˆåŠŸ
+ devise:
+ sessions:
+ new:
+ title: 登錄
+ remember_me: è¨˜ä½æˆ‘
+ submit: 登錄
+ registrations:
+ new:
+ title: 註冊
+ submit: 註冊
+ passwords:
+ new:
+ title: 忘記您的密碼?
+ submit: 給我發é€é‡è¨å¯†ç¢¼çš„æŒ‡å¼•
+ edit:
+ title: 更改您的密碼
+ submit: 更改密碼
+ confirmations:
+ new:
+ title: 釿–°ç™¼é€ç¢ºèªæŒ‡å¼•
+ submit: 釿–°ç™¼é€ç¢ºèªæŒ‡å¼•
+ links:
+ sign_in: 登錄
+ sign_up: 註冊
+ recover: 忘記您的密碼?
+ confirm: æ²’æœ‰æ”¶åˆ°ç¢ºèªæŒ‡å¼•?
+ sign_in_with: "用 %{provider}登錄"
+ errors:
+ primary_email: 您需è¦ç¢ºèªä¸»è¦éƒµç®±åœ°å€
+ onmiauth_info: 我們未æˆåŠŸç²å–您的信æ¯
+ activerecord:
+ attributes:
+ user:
+ email: é›»å郵箱
+ bitcoin_address: 比特幣地å€
+ password: 密碼
+ password_confirmation: 確èªå¯†ç¢¼
+ display_name: 顯示å稱
+ omniauth_providers:
+ github: GitHub
+ bitbucket: BitBucket
+ general:
+ or: 或者
+ disclaimer:
+ line1: "Tip4Commit ä¸éš¸å±¬æ–¼å¤§å¤šæ•¸é …目。"
+ line2: "ä¸ä¿è‰é–‹ç™¼äººå“¡å°‡æŽ¥å—打賞。"
+ line3: "æè´ˆå³ä»£è¡¨æ‚¨åŒæ„這些金é¡å¯ä»¥è¢«ç™¼é€çµ¦å…±äº«è»Ÿä»¶è¯ç›Ÿæˆ–å…¶ä»–Tip4Commitè£å®šçš„地方。"
From 6cacbfabf9fc929c7c82539b58f8cf3fb93b2a61 Mon Sep 17 00:00:00 2001
From: bashgnu <38274202+bashgnu@users.noreply.github.com>
Date: Tue, 17 Apr 2018 08:24:01 +0800
Subject: [PATCH 025/159] Added official twitter account to Readme.
---
README.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/README.md b/README.md
index e0401e91..478adcff 100644
--- a/README.md
+++ b/README.md
@@ -12,6 +12,7 @@ Official site | https://tip4commit.com/
Discussions | https://bitcointalk.org/index.php?topic=31580
FAQs | https://github.com/tip4commit/tip4commit/wiki/FAQ
Issues | https://github.com/tip4commit/tip4commit/issues
+Twitter | https://twitter.com/tip4commit
Developers
==========
From d0c3b0683e20a3527e26d02f012891629859a943 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 27 May 2018 19:27:05 +0200
Subject: [PATCH 026/159] updated rails-html-sanitizer
---
Gemfile.lock | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/Gemfile.lock b/Gemfile.lock
index a44127ee..be2ed0ea 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -118,7 +118,7 @@ GEM
connection_pool (2.2.0)
crack (0.4.3)
safe_yaml (~> 1.0.0)
- crass (1.0.3)
+ crass (1.0.4)
cucumber (1.3.20)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
@@ -205,7 +205,7 @@ GEM
actionpack (>= 3.1)
less (~> 2.4.0)
libv8 (3.16.14.19)
- loofah (2.1.1)
+ loofah (2.2.2)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.0)
@@ -225,7 +225,7 @@ GEM
net-ssh (>= 2.6.5)
net-ssh (4.1.0)
netrc (0.11.0)
- nokogiri (1.8.1)
+ nokogiri (1.8.2)
mini_portile2 (~> 2.3.0)
oauth2 (1.4.0)
faraday (>= 0.8, < 0.13)
@@ -263,8 +263,8 @@ GEM
activesupport (>= 4.2.0.beta, < 5.0)
nokogiri (~> 1.6)
rails-deprecated_sanitizer (>= 1.0.1)
- rails-html-sanitizer (1.0.3)
- loofah (~> 2.0)
+ rails-html-sanitizer (1.0.4)
+ loofah (~> 2.2, >= 2.2.2)
rails-i18n (4.0.3)
i18n (~> 0.6)
railties (~> 4.0)
From dbf504019d5fe754f38bb1115986e14ff4bae3a3 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 27 May 2018 19:30:39 +0200
Subject: [PATCH 027/159] added malaysian flag
---
app/assets/images/flags/my.png | Bin 0 -> 571 bytes
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 app/assets/images/flags/my.png
diff --git a/app/assets/images/flags/my.png b/app/assets/images/flags/my.png
new file mode 100644
index 0000000000000000000000000000000000000000..9034cbab2c02704b65fba6ecc4a7a1c1d053b6c5
GIT binary patch
literal 571
zcmV-B0>u4^P)Z-xKO+5@Bcl`=5c~|G$6#Vc^TNX8-{JF#yj01a@w+002>mTdm0Dxpa1{C#)An)W@eTA0)PNwiNI_f1h_u_DTrb&+z}xv;{Wj
zFGj0Cgf$G002ov
JPDHLkV1gu%1+M@A
literal 0
HcmV?d00001
From 41e6dce46407eceedd3b3ad7fc8bbf376b41cb31 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 27 May 2018 19:31:37 +0200
Subject: [PATCH 028/159] added malaysian to the list of locales
---
config/application.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/application.rb b/config/application.rb
index 48ab0f09..8411a688 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -25,7 +25,7 @@ class Application < Rails::Application
config.autoload_paths += %W[#{config.root}/lib]
config.assets.initialize_on_precompile = true
- config.available_locales = %w[en es fr nl ru pl hr de ro ko id ja pt]
+ config.available_locales = %w[en es fr nl ru pl hr de ro ko id ja pt my]
config.active_job.queue_adapter = :sidekiq
end
end
From 71f3e5be7f1913f921c56a991f8b3a320c8ae4bc Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Mon, 28 May 2018 21:31:04 +0200
Subject: [PATCH 029/159] fixed chinese locales
---
config/locales/cn.yml | 2 +-
config/locales/hk.yml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/config/locales/cn.yml b/config/locales/cn.yml
index a9814213..b536d3e4 100644
--- a/config/locales/cn.yml
+++ b/config/locales/cn.yml
@@ -1,4 +1,4 @@
-en:
+cn:
tip4commit: Tip4Commit
meta:
title: 为开æºåšè´¡çŒ®
diff --git a/config/locales/hk.yml b/config/locales/hk.yml
index 1f5e0b1d..b739fb49 100644
--- a/config/locales/hk.yml
+++ b/config/locales/hk.yml
@@ -1,4 +1,4 @@
-en:
+hk:
tip4commit: Tip4Commit
meta:
title: 為開æºåšè²¢ç»
From 7690014fba15f16a60165e95374fb51631732f16 Mon Sep 17 00:00:00 2001
From: "Brian (bex) Exelbierd"
Date: Sun, 10 Jun 2018 19:29:59 +0200
Subject: [PATCH 030/159] Fix spelling and replace non-word
---
config/locales/en.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 6ba186f1..7411f4f0 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -60,7 +60,7 @@ en:
button: Learn about Bitcoin
donate:
title: Donate
- text: Find a project you like and deposit bitcoins into it. Your donation will be accumulated with the funds of other donators to give as tips for new commits.
+ text: Find a project you like and deposit bitcoins into it. Your donation will be accumulated with the funds of other donors to give as tips for new commits.
button: Find or add a project
contribute:
title: Contribute
@@ -138,7 +138,7 @@ en:
project_tips: '%{project} tips'
user_tips: "%{user} tips"
created_at: Created At
- commiter: Commiter
+ commiter: Committer
project: Project
commit: Commit
amount: Amount
From 835fa6da50f0c6d8750e8344584debd8b9beb5f7 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 24 Jun 2018 11:15:02 +0200
Subject: [PATCH 031/159] updated sprocket to fix CVE-2018-3760
---
Gemfile | 1 +
Gemfile.lock | 7 ++++---
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/Gemfile b/Gemfile
index 2ca86ae4..62ebbcb2 100644
--- a/Gemfile
+++ b/Gemfile
@@ -35,6 +35,7 @@ gem 'sass-rails', '~> 4.0.0'
gem 'sawyer', '~> 0.8.0'
gem 'sdoc', group: :doc, require: false
gem 'sidekiq'
+gem 'sprockets', '~> 2.12.5'
gem 'therubyracer', '~> 0.12.2', platforms: :ruby
gem 'turbolinks', '~> 2.5.0'
gem 'twitter-bootstrap-rails', github: 'seyhunak/twitter-bootstrap-rails', branch: 'bootstrap3'
diff --git a/Gemfile.lock b/Gemfile.lock
index be2ed0ea..8db07a31 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -216,7 +216,7 @@ GEM
minitest (5.10.3)
money-tree (0.9.0)
ffi
- multi_json (1.12.2)
+ multi_json (1.13.1)
multi_test (0.1.2)
multi_xml (0.6.0)
multipart-post (2.0.0)
@@ -243,7 +243,7 @@ GEM
omniauth (~> 1.2)
orm_adapter (0.5.0)
public_suffix (3.0.1)
- rack (1.6.8)
+ rack (1.6.10)
rack-test (0.6.3)
rack (>= 1.0)
rails (4.2.10)
@@ -334,7 +334,7 @@ GEM
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
- sprockets (2.12.4)
+ sprockets (2.12.5)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
@@ -423,6 +423,7 @@ DEPENDENCIES
shoulda-matchers (~> 3.1)
sidekiq
simplecov
+ sprockets (~> 2.12.5)
sqlite3 (~> 1.3.11)
therubyracer (~> 0.12.2)
turbolinks (~> 2.5.0)
From 2efc74fb4a5cd247423a273c0a2f810b78ffcf5e Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 2 Dec 2018 16:58:52 +0100
Subject: [PATCH 032/159] upgraded rails and ffi gems
---
Gemfile | 6 ++--
Gemfile.lock | 92 ++++++++++++++++++++++++++--------------------------
2 files changed, 49 insertions(+), 49 deletions(-)
diff --git a/Gemfile b/Gemfile
index 62ebbcb2..44975f43 100644
--- a/Gemfile
+++ b/Gemfile
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
ruby '2.4.2'
-gem 'rails', '4.2.10'
+gem 'rails', '4.2.11'
gem 'acts_as_paranoid', github: 'ActsAsParanoid/acts_as_paranoid'
gem 'airbrake', '~> 3.1.15'
@@ -23,7 +23,7 @@ gem 'jquery-turbolinks'
gem 'kaminari', '~> 0.15.0'
gem 'kaminari-i18n'
gem 'less-rails', '~> 2.4.2'
-gem 'money-tree', '~> 0.9.0'
+gem 'money-tree', '~> 0.10.0'
gem 'mysql2', group: :production
gem 'octokit', '~> 4.7.0'
gem 'omniauth', '~> 1.7.1'
@@ -66,6 +66,6 @@ group :test do
gem 'rspec-activemodel-mocks'
gem 'shoulda-matchers', '~> 3.1'
gem 'simplecov'
- gem 'webmock'
gem 'vcr'
+ gem 'webmock'
end
diff --git a/Gemfile.lock b/Gemfile.lock
index 8db07a31..70903189 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -43,36 +43,36 @@ GIT
GEM
remote: https://rubygems.org/
specs:
- actionmailer (4.2.10)
- actionpack (= 4.2.10)
- actionview (= 4.2.10)
- activejob (= 4.2.10)
+ actionmailer (4.2.11)
+ actionpack (= 4.2.11)
+ actionview (= 4.2.11)
+ activejob (= 4.2.11)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5)
- actionpack (4.2.10)
- actionview (= 4.2.10)
- activesupport (= 4.2.10)
+ actionpack (4.2.11)
+ actionview (= 4.2.11)
+ activesupport (= 4.2.11)
rack (~> 1.6)
rack-test (~> 0.6.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
- actionview (4.2.10)
- activesupport (= 4.2.10)
+ actionview (4.2.11)
+ activesupport (= 4.2.11)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
- activejob (4.2.10)
- activesupport (= 4.2.10)
+ activejob (4.2.11)
+ activesupport (= 4.2.11)
globalid (>= 0.3.0)
- activemodel (4.2.10)
- activesupport (= 4.2.10)
+ activemodel (4.2.11)
+ activesupport (= 4.2.11)
builder (~> 3.1)
- activerecord (4.2.10)
- activemodel (= 4.2.10)
- activesupport (= 4.2.10)
+ activerecord (4.2.11)
+ activemodel (= 4.2.11)
+ activesupport (= 4.2.11)
arel (~> 6.0)
- activesupport (4.2.10)
+ activesupport (4.2.11)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
@@ -114,7 +114,7 @@ GEM
execjs
coffee-script-source (1.9.1.1)
commonjs (0.2.7)
- concurrent-ruby (1.0.5)
+ concurrent-ruby (1.1.3)
connection_pool (2.2.0)
crack (0.4.3)
safe_yaml (~> 1.0.0)
@@ -160,7 +160,7 @@ GEM
railties (>= 3.0.0)
faraday (0.12.2)
multipart-post (>= 1.2, < 3)
- ffi (1.9.18)
+ ffi (1.9.25)
gherkin (2.12.2)
multi_json (~> 1.3)
globalid (0.4.1)
@@ -178,7 +178,7 @@ GEM
http-cookie (1.0.2)
domain_name (~> 0.5)
http_accept_language (2.0.2)
- i18n (0.9.1)
+ i18n (0.9.5)
concurrent-ruby (~> 1.0)
i18n-js (2.1.2)
i18n
@@ -205,16 +205,16 @@ GEM
actionpack (>= 3.1)
less (~> 2.4.0)
libv8 (3.16.14.19)
- loofah (2.2.2)
+ loofah (2.2.3)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
- mail (2.7.0)
+ mail (2.7.1)
mini_mime (>= 0.1.1)
mime-types (2.99.3)
- mini_mime (1.0.0)
+ mini_mime (1.0.1)
mini_portile2 (2.3.0)
- minitest (5.10.3)
- money-tree (0.9.0)
+ minitest (5.11.3)
+ money-tree (0.10.0)
ffi
multi_json (1.13.1)
multi_test (0.1.2)
@@ -225,7 +225,7 @@ GEM
net-ssh (>= 2.6.5)
net-ssh (4.1.0)
netrc (0.11.0)
- nokogiri (1.8.2)
+ nokogiri (1.8.5)
mini_portile2 (~> 2.3.0)
oauth2 (1.4.0)
faraday (>= 0.8, < 0.13)
@@ -243,24 +243,24 @@ GEM
omniauth (~> 1.2)
orm_adapter (0.5.0)
public_suffix (3.0.1)
- rack (1.6.10)
+ rack (1.6.11)
rack-test (0.6.3)
rack (>= 1.0)
- rails (4.2.10)
- actionmailer (= 4.2.10)
- actionpack (= 4.2.10)
- actionview (= 4.2.10)
- activejob (= 4.2.10)
- activemodel (= 4.2.10)
- activerecord (= 4.2.10)
- activesupport (= 4.2.10)
+ rails (4.2.11)
+ actionmailer (= 4.2.11)
+ actionpack (= 4.2.11)
+ actionview (= 4.2.11)
+ activejob (= 4.2.11)
+ activemodel (= 4.2.11)
+ activerecord (= 4.2.11)
+ activesupport (= 4.2.11)
bundler (>= 1.3.0, < 2.0)
- railties (= 4.2.10)
+ railties (= 4.2.11)
sprockets-rails
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
- rails-dom-testing (1.0.8)
- activesupport (>= 4.2.0.beta, < 5.0)
+ rails-dom-testing (1.0.9)
+ activesupport (>= 4.2.0, < 5.0)
nokogiri (~> 1.6)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.4)
@@ -268,12 +268,12 @@ GEM
rails-i18n (4.0.3)
i18n (~> 0.6)
railties (~> 4.0)
- railties (4.2.10)
- actionpack (= 4.2.10)
- activesupport (= 4.2.10)
+ railties (4.2.11)
+ actionpack (= 4.2.11)
+ activesupport (= 4.2.11)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
- rake (12.3.0)
+ rake (12.3.1)
rbnacl (3.4.0)
ffi
rbnacl-libsodium (1.0.11)
@@ -350,12 +350,12 @@ GEM
therubyracer (0.12.3)
libv8 (~> 3.16.14.15)
ref
- thor (0.20.0)
+ thor (0.20.3)
thread_safe (0.3.6)
tilt (1.4.1)
turbolinks (2.5.3)
coffee-rails
- tzinfo (1.2.4)
+ tzinfo (1.2.5)
thread_safe (~> 0.1)
uglifier (2.4.0)
execjs (>= 0.3.0)
@@ -404,12 +404,12 @@ DEPENDENCIES
kaminari (~> 0.15.0)
kaminari-i18n
less-rails (~> 2.4.2)
- money-tree (~> 0.9.0)
+ money-tree (~> 0.10.0)
mysql2
octokit (~> 4.7.0)
omniauth (~> 1.7.1)
omniauth-github!
- rails (= 4.2.10)
+ rails (= 4.2.11)
rails-i18n (~> 4.0.0)
rbnacl (~> 3.4.0)
rbnacl-libsodium (~> 1.0.0)
From 8a7464f5f05846cb2a1b8a952a397a6f10256ad0 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 2 Dec 2018 17:16:01 +0100
Subject: [PATCH 033/159] fixed mailer spec
---
spec/mailers/user_mailer_spec.rb | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/spec/mailers/user_mailer_spec.rb b/spec/mailers/user_mailer_spec.rb
index 34211ffd..efe05a40 100644
--- a/spec/mailers/user_mailer_spec.rb
+++ b/spec/mailers/user_mailer_spec.rb
@@ -2,7 +2,16 @@
describe UserMailer do
describe 'new_tip' do
- let(:user) { mock_model User, name: 'kd', email: 'kd.engineer@yahoo.co.in', display_name: 'kuldeep aggarwal', login_token: 'my login token', balance: 10 }
+ let(:user) do
+ mock_model(
+ User,
+ name: 'kd',
+ email: 'kd.engineer@yahoo.co.in',
+ display_name: 'kuldeep aggarwal',
+ login_token: 'my login token',
+ balance: 10
+ )
+ end
let(:project) { mock_model Project, full_name: 'logger-extension' }
let(:tip) { mock_model Tip, amount: 0.0001, project: project }
let(:mail) { UserMailer.new_tip(user, tip) }
@@ -27,7 +36,7 @@
expected_text = [
'Please, log in and tell us your bitcoin address to get it.
',
'Your current balance is 0.00000010 Ƀ'
- ].join("\n")
+ ].join("\r\n")
expect(mail.body.encoded).to match expected_text
end
From 6500bd04e53b4d3a9501fd940ab853bc2dcef7c9 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 2 Dec 2018 17:30:21 +0100
Subject: [PATCH 034/159] upgraded ruby ro 2.4.5
---
.travis.yml | 2 +-
Gemfile | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index ec654f5a..07bbb18b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,7 +6,7 @@ git:
depth: 10
rvm:
- - 2.4.2
+ - 2.4.5
bundler_args: --without development --jobs=9 --retry=2 --quiet
diff --git a/Gemfile b/Gemfile
index 44975f43..284e1e70 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,6 +1,6 @@
source 'https://rubygems.org'
-ruby '2.4.2'
+ruby '2.4.5'
gem 'rails', '4.2.11'
From 505aedad802095ea65fe061de453c51988405dc4 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 2 Dec 2018 18:09:22 +0100
Subject: [PATCH 035/159] use ruby 2.4.5 in production
---
config/deploy.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/deploy.rb b/config/deploy.rb
index 2b4b8bd9..c5dfdfb4 100644
--- a/config/deploy.rb
+++ b/config/deploy.rb
@@ -7,7 +7,7 @@
set :scm, :git
set :rvm_type, :user
-set :rvm_ruby_version, '2.4.2'
+set :rvm_ruby_version, '2.4.5'
set :rvm_custom_path, '~/.rvm'
set :format, :pretty
From cae90fe7d462418e2b576c8dc31da51dd1e9524e Mon Sep 17 00:00:00 2001
From: "Brian (bex) Exelbierd"
Date: Tue, 24 Sep 2019 11:52:27 +0200
Subject: [PATCH 036/159] Add Year to date displays
Fixes #370
---
app/views/deposits/index.html.haml | 2 +-
app/views/projects/show.html.haml | 2 +-
app/views/tips/index.html.haml | 2 +-
app/views/users/show.html.haml | 2 +-
app/views/withdrawals/index.html.haml | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/app/views/deposits/index.html.haml b/app/views/deposits/index.html.haml
index 94cdce69..47db0db6 100644
--- a/app/views/deposits/index.html.haml
+++ b/app/views/deposits/index.html.haml
@@ -17,7 +17,7 @@
%tbody
- @deposits.each do |deposit|
%tr
- %td= l deposit.created_at, format: :short
+ %td= l deposit.created_at, format: :long
- unless @project
%td= link_to(deposit.project.full_name, pretty_project_path(deposit.project))
%td= btc_human deposit.amount
diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml
index 0ab43a02..a05e85da 100644
--- a/app/views/projects/show.html.haml
+++ b/app/views/projects/show.html.haml
@@ -78,7 +78,7 @@
%ul
- @recent_tips.each do |tip|
%li
- = l tip.created_at, format: :short
+ = l tip.created_at, format: :long
- if tip.user.nickname.blank?
= tip.user.display_name
- else
diff --git a/app/views/tips/index.html.haml b/app/views/tips/index.html.haml
index 308b7487..af1ff4d6 100644
--- a/app/views/tips/index.html.haml
+++ b/app/views/tips/index.html.haml
@@ -20,7 +20,7 @@
%tbody
- @tips.each do |tip|
%tr
- %td= l tip.created_at, format: :short
+ %td= l tip.created_at, format: :long
- unless @user
%td
- if tip.user.nickname.blank?
diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml
index 1792e2a4..e4710db2 100644
--- a/app/views/users/show.html.haml
+++ b/app/views/users/show.html.haml
@@ -18,7 +18,7 @@
%ul
- @recent_tips.each do |tip|
%li
- = raw t('.received', time: l(tip.created_at, format: :short), amount: btc_human(tip.amount), commit: (tip.commit.start_with?('http') ? link_to('details', tip.commit, target: :blank) : link_to(tip.commit[0..6], "https://github.com/#{tip.project.full_name}/commit/#{tip.commit}", target: :blank)), project: link_to(tip.project.full_name, pretty_project_path(tip.project)))
+ = raw t('.received', time: l(tip.created_at, format: :long), amount: btc_human(tip.amount), commit: (tip.commit.start_with?('http') ? link_to('details', tip.commit, target: :blank) : link_to(tip.commit[0..6], "https://github.com/#{tip.project.full_name}/commit/#{tip.commit}", target: :blank)), project: link_to(tip.project.full_name, pretty_project_path(tip.project)))
%p
%strong= User.human_attribute_name(:email)
diff --git a/app/views/withdrawals/index.html.haml b/app/views/withdrawals/index.html.haml
index 2ce24e30..75e85fca 100644
--- a/app/views/withdrawals/index.html.haml
+++ b/app/views/withdrawals/index.html.haml
@@ -9,6 +9,6 @@
%tbody
- @sendmanies.each do |sendmany|
%tr
- %td= l(sendmany.created_at, format: :short)
+ %td= l(sendmany.created_at, format: :long)
%td= link_to sendmany.txid, "#{block_explorer_tx_url(sendmany.txid)}", target: '_blank'
%td= sendmany.is_error ? t('.error') : t('.success')
From b3311ec9ddf36043e073dda56a6954d8225b3a8f Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Wed, 6 Nov 2019 21:03:08 +0000
Subject: [PATCH 037/159] Bump loofah from 2.2.3 to 2.3.1
Bumps [loofah](https://github.com/flavorjones/loofah) from 2.2.3 to 2.3.1.
- [Release notes](https://github.com/flavorjones/loofah/releases)
- [Changelog](https://github.com/flavorjones/loofah/blob/master/CHANGELOG.md)
- [Commits](https://github.com/flavorjones/loofah/compare/v2.2.3...v2.3.1)
Signed-off-by: dependabot[bot]
---
Gemfile.lock | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/Gemfile.lock b/Gemfile.lock
index 70903189..9a2a87aa 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -118,7 +118,7 @@ GEM
connection_pool (2.2.0)
crack (0.4.3)
safe_yaml (~> 1.0.0)
- crass (1.0.4)
+ crass (1.0.5)
cucumber (1.3.20)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
@@ -205,14 +205,14 @@ GEM
actionpack (>= 3.1)
less (~> 2.4.0)
libv8 (3.16.14.19)
- loofah (2.2.3)
+ loofah (2.3.1)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
mime-types (2.99.3)
mini_mime (1.0.1)
- mini_portile2 (2.3.0)
+ mini_portile2 (2.4.0)
minitest (5.11.3)
money-tree (0.10.0)
ffi
@@ -225,8 +225,8 @@ GEM
net-ssh (>= 2.6.5)
net-ssh (4.1.0)
netrc (0.11.0)
- nokogiri (1.8.5)
- mini_portile2 (~> 2.3.0)
+ nokogiri (1.10.5)
+ mini_portile2 (~> 2.4.0)
oauth2 (1.4.0)
faraday (>= 0.8, < 0.13)
jwt (~> 1.0)
From 88e9f10e7b83272f9ae99f3db61d4f566e968b5b Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Thu, 19 Dec 2019 03:23:49 +0000
Subject: [PATCH 038/159] Bump rack from 1.6.11 to 1.6.12
Bumps [rack](https://github.com/rack/rack) from 1.6.11 to 1.6.12.
- [Release notes](https://github.com/rack/rack/releases)
- [Changelog](https://github.com/rack/rack/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rack/rack/compare/1.6.11...1.6.12)
Signed-off-by: dependabot[bot]
---
Gemfile.lock | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Gemfile.lock b/Gemfile.lock
index 9a2a87aa..a5452b16 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -243,7 +243,7 @@ GEM
omniauth (~> 1.2)
orm_adapter (0.5.0)
public_suffix (3.0.1)
- rack (1.6.11)
+ rack (1.6.12)
rack-test (0.6.3)
rack (>= 1.0)
rails (4.2.11)
From 23fb5c5995e157f1543da89c7731ee9052fff4a3 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 24 Feb 2020 23:04:39 +0000
Subject: [PATCH 039/159] Bump nokogiri from 1.10.5 to 1.10.8
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.10.5 to 1.10.8.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.10.5...v1.10.8)
Signed-off-by: dependabot[bot]
---
Gemfile.lock | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Gemfile.lock b/Gemfile.lock
index a5452b16..49245974 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -225,7 +225,7 @@ GEM
net-ssh (>= 2.6.5)
net-ssh (4.1.0)
netrc (0.11.0)
- nokogiri (1.10.5)
+ nokogiri (1.10.8)
mini_portile2 (~> 2.4.0)
oauth2 (1.4.0)
faraday (>= 0.8, < 0.13)
From 1fcb6e1f417e8c2b0685c9c71f020142110784f4 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 28 Feb 2020 22:06:56 +0000
Subject: [PATCH 040/159] Bump rake from 12.3.1 to 13.0.1
Bumps [rake](https://github.com/ruby/rake) from 12.3.1 to 13.0.1.
- [Release notes](https://github.com/ruby/rake/releases)
- [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc)
- [Commits](https://github.com/ruby/rake/compare/v12.3.1...v13.0.1)
Signed-off-by: dependabot[bot]
---
Gemfile.lock | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Gemfile.lock b/Gemfile.lock
index a5452b16..5515dcf3 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -273,7 +273,7 @@ GEM
activesupport (= 4.2.11)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
- rake (12.3.1)
+ rake (13.0.1)
rbnacl (3.4.0)
ffi
rbnacl-libsodium (1.0.11)
From de3b6d790c44fb600f5528585efa50380422e1be Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Mon, 9 Mar 2020 20:20:31 +0100
Subject: [PATCH 041/159] use coindesk instead of bitcoinaverage for currency
conversion
---
app/helpers/application_helper.rb | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 1c7f04c9..398ddcee 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -151,11 +151,11 @@ def rate(currency, satoshies)
end
def get_rate(currency)
- Rails.cache.fetch('###' + currency, expires_in: 24.hours) do
- uri = URI('https://apiv2.bitcoinaverage.com/indices/global/ticker/BTC' + currency)
+ Rails.cache.fetch('###' + currency, expires_in: 1.hours) do
+ uri = URI('https://api.coindesk.com/v1/bpi/currentprice/' + currency + '.json')
response = Net::HTTP.get_response(uri)
hash = JSON.parse(response.body)
- hash['averages']['day'].to_f
+ hash['bpi'][currency]['rate_float'].to_f
end
end
From 60ce433b1e2aafb7d54eed721ddcec17b102071e Mon Sep 17 00:00:00 2001
From: Markus Amalthea Magnuson
Date: Thu, 27 Aug 2020 11:40:38 +0200
Subject: [PATCH 042/159] Update blacklist.yml
---
config/blacklist.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/config/blacklist.yml b/config/blacklist.yml
index 78b26d62..ff1c6d2d 100644
--- a/config/blacklist.yml
+++ b/config/blacklist.yml
@@ -36,3 +36,4 @@
- https://github.com/KnightOS/*
- https://github.com/KerbalStuff/*
- https://github.com/digipost/*
+- https://github.com/alimony/*
From d0eca2385eb51d02472a0bfc4efe737a9edc72e4 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sat, 7 Nov 2020 13:22:31 +0100
Subject: [PATCH 043/159] upgraded ruby and some gems
---
.travis.yml | 2 +-
Gemfile | 7 ++--
Gemfile.lock | 99 ++++++++++++++++++++++++------------------------
config/deploy.rb | 2 +-
4 files changed, 56 insertions(+), 54 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 07bbb18b..e3edf7f1 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,7 +6,7 @@ git:
depth: 10
rvm:
- - 2.4.5
+ - 2.4.9
bundler_args: --without development --jobs=9 --retry=2 --quiet
diff --git a/Gemfile b/Gemfile
index 284e1e70..8a6f3c6c 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,11 +1,12 @@
source 'https://rubygems.org'
-ruby '2.4.5'
+ruby '2.4.9'
-gem 'rails', '4.2.11'
+gem 'rails', '4.2.11.3'
gem 'acts_as_paranoid', github: 'ActsAsParanoid/acts_as_paranoid'
gem 'airbrake', '~> 3.1.15'
+gem 'bcrypt', '~> 3.1.12'
gem 'bootstrap_form', github: 'bootstrap-ruby/rails-bootstrap-forms'
gem 'cancancan'
gem 'coffee-rails', '~> 4.0.0'
@@ -24,7 +25,7 @@ gem 'kaminari', '~> 0.15.0'
gem 'kaminari-i18n'
gem 'less-rails', '~> 2.4.2'
gem 'money-tree', '~> 0.10.0'
-gem 'mysql2', group: :production
+gem 'mysql2', '~> 0.4.10', group: :production
gem 'octokit', '~> 4.7.0'
gem 'omniauth', '~> 1.7.1'
gem 'omniauth-github', github: 'alexandrz/omniauth-github', branch: 'provide_emails'
diff --git a/Gemfile.lock b/Gemfile.lock
index 034eb8a2..1a6d0641 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -43,36 +43,36 @@ GIT
GEM
remote: https://rubygems.org/
specs:
- actionmailer (4.2.11)
- actionpack (= 4.2.11)
- actionview (= 4.2.11)
- activejob (= 4.2.11)
+ actionmailer (4.2.11.3)
+ actionpack (= 4.2.11.3)
+ actionview (= 4.2.11.3)
+ activejob (= 4.2.11.3)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5)
- actionpack (4.2.11)
- actionview (= 4.2.11)
- activesupport (= 4.2.11)
+ actionpack (4.2.11.3)
+ actionview (= 4.2.11.3)
+ activesupport (= 4.2.11.3)
rack (~> 1.6)
rack-test (~> 0.6.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
- actionview (4.2.11)
- activesupport (= 4.2.11)
+ actionview (4.2.11.3)
+ activesupport (= 4.2.11.3)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
- activejob (4.2.11)
- activesupport (= 4.2.11)
+ activejob (4.2.11.3)
+ activesupport (= 4.2.11.3)
globalid (>= 0.3.0)
- activemodel (4.2.11)
- activesupport (= 4.2.11)
+ activemodel (4.2.11.3)
+ activesupport (= 4.2.11.3)
builder (~> 3.1)
- activerecord (4.2.11)
- activemodel (= 4.2.11)
- activesupport (= 4.2.11)
+ activerecord (4.2.11.3)
+ activemodel (= 4.2.11.3)
+ activesupport (= 4.2.11.3)
arel (~> 6.0)
- activesupport (4.2.11)
+ activesupport (4.2.11.3)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
@@ -83,9 +83,9 @@ GEM
builder
multi_json
arel (6.0.4)
- bcrypt (3.1.10)
+ bcrypt (3.1.16)
bcrypt_pbkdf (1.0.0)
- builder (3.2.3)
+ builder (3.2.4)
cancancan (1.7.1)
capistrano (3.4.1)
i18n
@@ -114,11 +114,11 @@ GEM
execjs
coffee-script-source (1.9.1.1)
commonjs (0.2.7)
- concurrent-ruby (1.1.3)
+ concurrent-ruby (1.1.7)
connection_pool (2.2.0)
crack (0.4.3)
safe_yaml (~> 1.0.0)
- crass (1.0.5)
+ crass (1.0.6)
cucumber (1.3.20)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
@@ -163,7 +163,7 @@ GEM
ffi (1.9.25)
gherkin (2.12.2)
multi_json (~> 1.3)
- globalid (0.4.1)
+ globalid (0.4.2)
activesupport (>= 4.2.0)
haml (4.0.5)
tilt
@@ -205,27 +205,27 @@ GEM
actionpack (>= 3.1)
less (~> 2.4.0)
libv8 (3.16.14.19)
- loofah (2.3.1)
+ loofah (2.7.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
mime-types (2.99.3)
- mini_mime (1.0.1)
+ mini_mime (1.0.2)
mini_portile2 (2.4.0)
- minitest (5.11.3)
+ minitest (5.14.2)
money-tree (0.10.0)
ffi
- multi_json (1.13.1)
+ multi_json (1.15.0)
multi_test (0.1.2)
multi_xml (0.6.0)
multipart-post (2.0.0)
- mysql2 (0.3.14)
+ mysql2 (0.4.10)
net-scp (1.2.1)
net-ssh (>= 2.6.5)
net-ssh (4.1.0)
netrc (0.11.0)
- nokogiri (1.10.8)
+ nokogiri (1.10.10)
mini_portile2 (~> 2.4.0)
oauth2 (1.4.0)
faraday (>= 0.8, < 0.13)
@@ -243,19 +243,19 @@ GEM
omniauth (~> 1.2)
orm_adapter (0.5.0)
public_suffix (3.0.1)
- rack (1.6.12)
+ rack (1.6.13)
rack-test (0.6.3)
rack (>= 1.0)
- rails (4.2.11)
- actionmailer (= 4.2.11)
- actionpack (= 4.2.11)
- actionview (= 4.2.11)
- activejob (= 4.2.11)
- activemodel (= 4.2.11)
- activerecord (= 4.2.11)
- activesupport (= 4.2.11)
+ rails (4.2.11.3)
+ actionmailer (= 4.2.11.3)
+ actionpack (= 4.2.11.3)
+ actionview (= 4.2.11.3)
+ activejob (= 4.2.11.3)
+ activemodel (= 4.2.11.3)
+ activerecord (= 4.2.11.3)
+ activesupport (= 4.2.11.3)
bundler (>= 1.3.0, < 2.0)
- railties (= 4.2.11)
+ railties (= 4.2.11.3)
sprockets-rails
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
@@ -263,14 +263,14 @@ GEM
activesupport (>= 4.2.0, < 5.0)
nokogiri (~> 1.6)
rails-deprecated_sanitizer (>= 1.0.1)
- rails-html-sanitizer (1.0.4)
- loofah (~> 2.2, >= 2.2.2)
+ rails-html-sanitizer (1.3.0)
+ loofah (~> 2.3)
rails-i18n (4.0.3)
i18n (~> 0.6)
railties (~> 4.0)
- railties (4.2.11)
- actionpack (= 4.2.11)
- activesupport (= 4.2.11)
+ railties (4.2.11.3)
+ actionpack (= 4.2.11.3)
+ activesupport (= 4.2.11.3)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (13.0.1)
@@ -350,12 +350,12 @@ GEM
therubyracer (0.12.3)
libv8 (~> 3.16.14.15)
ref
- thor (0.20.3)
+ thor (1.0.1)
thread_safe (0.3.6)
tilt (1.4.1)
turbolinks (2.5.3)
coffee-rails
- tzinfo (1.2.5)
+ tzinfo (1.2.7)
thread_safe (~> 0.1)
uglifier (2.4.0)
execjs (>= 0.3.0)
@@ -379,6 +379,7 @@ PLATFORMS
DEPENDENCIES
acts_as_paranoid!
airbrake (~> 3.1.15)
+ bcrypt (~> 3.1.12)
bcrypt_pbkdf (~> 1.0.0)
bootstrap_form!
cancancan
@@ -405,11 +406,11 @@ DEPENDENCIES
kaminari-i18n
less-rails (~> 2.4.2)
money-tree (~> 0.10.0)
- mysql2
+ mysql2 (~> 0.4.10)
octokit (~> 4.7.0)
omniauth (~> 1.7.1)
omniauth-github!
- rails (= 4.2.11)
+ rails (= 4.2.11.3)
rails-i18n (~> 4.0.0)
rbnacl (~> 3.4.0)
rbnacl-libsodium (~> 1.0.0)
@@ -434,7 +435,7 @@ DEPENDENCIES
webmock
RUBY VERSION
- ruby 2.4.2p198
+ ruby 2.4.9p362
BUNDLED WITH
- 1.16.0
+ 1.17.3
diff --git a/config/deploy.rb b/config/deploy.rb
index c5dfdfb4..0a85b48c 100644
--- a/config/deploy.rb
+++ b/config/deploy.rb
@@ -7,7 +7,7 @@
set :scm, :git
set :rvm_type, :user
-set :rvm_ruby_version, '2.4.5'
+set :rvm_ruby_version, '2.4.9'
set :rvm_custom_path, '~/.rvm'
set :format, :pretty
From e8c39aee742c2cd5228c53cccba5610b95f804b5 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sat, 7 Nov 2020 13:24:33 +0100
Subject: [PATCH 044/159] added gemset file
---
.ruby-gemset | 1 +
1 file changed, 1 insertion(+)
create mode 100644 .ruby-gemset
diff --git a/.ruby-gemset b/.ruby-gemset
new file mode 100644
index 00000000..b293c2f3
--- /dev/null
+++ b/.ruby-gemset
@@ -0,0 +1 @@
+tip4commit
From a4e09eb2860ba00d31dce49095ee47234b5c5c16 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sat, 7 Nov 2020 12:33:17 +0000
Subject: [PATCH 045/159] Bump kaminari from 0.15.0 to 1.2.1
Bumps [kaminari](https://github.com/kaminari/kaminari) from 0.15.0 to 1.2.1.
- [Release notes](https://github.com/kaminari/kaminari/releases)
- [Changelog](https://github.com/kaminari/kaminari/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kaminari/kaminari/compare/v0.15.0...v1.2.1)
Signed-off-by: dependabot[bot]
---
Gemfile | 2 +-
Gemfile.lock | 17 +++++++++++++----
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/Gemfile b/Gemfile
index 8a6f3c6c..a81f8186 100644
--- a/Gemfile
+++ b/Gemfile
@@ -21,7 +21,7 @@ gem 'i18n-js'
gem 'jbuilder', '~> 1.5.3'
gem 'jquery-rails', '~> 3.1'
gem 'jquery-turbolinks'
-gem 'kaminari', '~> 0.15.0'
+gem 'kaminari', '~> 1.2.1'
gem 'kaminari-i18n'
gem 'less-rails', '~> 2.4.2'
gem 'money-tree', '~> 0.10.0'
diff --git a/Gemfile.lock b/Gemfile.lock
index 1a6d0641..92e2d1b4 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -193,9 +193,18 @@ GEM
turbolinks
json (1.8.6)
jwt (1.5.6)
- kaminari (0.15.0)
- actionpack (>= 3.0.0)
- activesupport (>= 3.0.0)
+ kaminari (1.2.1)
+ activesupport (>= 4.1.0)
+ kaminari-actionview (= 1.2.1)
+ kaminari-activerecord (= 1.2.1)
+ kaminari-core (= 1.2.1)
+ kaminari-actionview (1.2.1)
+ actionview
+ kaminari-core (= 1.2.1)
+ kaminari-activerecord (1.2.1)
+ activerecord
+ kaminari-core (= 1.2.1)
+ kaminari-core (1.2.1)
kaminari-i18n (0.2.0)
kaminari
rails
@@ -402,7 +411,7 @@ DEPENDENCIES
jbuilder (~> 1.5.3)
jquery-rails (~> 3.1)
jquery-turbolinks
- kaminari (~> 0.15.0)
+ kaminari (~> 1.2.1)
kaminari-i18n
less-rails (~> 2.4.2)
money-tree (~> 0.10.0)
From 1770ecc036c0dd2326a31f547b1dabb40b607556 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 8 Nov 2020 12:11:53 +0100
Subject: [PATCH 046/159] updated omniauth to remove github deprecation warning
---
Gemfile | 8 ++++----
Gemfile.lock | 50 ++++++++++++++++++++++----------------------------
2 files changed, 26 insertions(+), 32 deletions(-)
diff --git a/Gemfile b/Gemfile
index a81f8186..258f2ad1 100644
--- a/Gemfile
+++ b/Gemfile
@@ -27,8 +27,8 @@ gem 'less-rails', '~> 2.4.2'
gem 'money-tree', '~> 0.10.0'
gem 'mysql2', '~> 0.4.10', group: :production
gem 'octokit', '~> 4.7.0'
-gem 'omniauth', '~> 1.7.1'
-gem 'omniauth-github', github: 'alexandrz/omniauth-github', branch: 'provide_emails'
+gem 'omniauth', '~> 1.9.1'
+gem 'omniauth-github'
gem 'rails-i18n', '~> 4.0.0'
gem 'render_csv'
gem 'rest-client'
@@ -51,8 +51,8 @@ group :development do
# add ed25519 support to net-ssh
gem 'bcrypt_pbkdf', '~> 1.0.0'
- gem 'rbnacl', '~> 3.4.0'
- gem 'rbnacl-libsodium', '~> 1.0.0'
+ gem 'rbnacl'
+ gem 'rbnacl-libsodium'
end
group :development, :test do
diff --git a/Gemfile.lock b/Gemfile.lock
index 92e2d1b4..f1dfdcf5 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -6,15 +6,6 @@ GIT
activerecord (~> 4.0)
activesupport (~> 4.0)
-GIT
- remote: git://github.com/alexandrz/omniauth-github.git
- revision: 37a030aa37659831ef80af21b5c7270fe1384b3c
- branch: provide_emails
- specs:
- omniauth-github (1.1.0)
- omniauth (~> 1.0)
- omniauth-oauth2 (~> 1.1)
-
GIT
remote: git://github.com/bootstrap-ruby/rails-bootstrap-forms.git
revision: bb5e1ca8b8fdb6405feb162338e45468dac83c30
@@ -158,9 +149,9 @@ GEM
factory_girl_rails (4.3.0)
factory_girl (~> 4.3.0)
railties (>= 3.0.0)
- faraday (0.12.2)
+ faraday (0.17.3)
multipart-post (>= 1.2, < 3)
- ffi (1.9.25)
+ ffi (1.13.1)
gherkin (2.12.2)
multi_json (~> 1.3)
globalid (0.4.2)
@@ -173,7 +164,7 @@ GEM
haml (>= 3.1, < 5.0)
railties (>= 4.0.1)
hashdiff (0.3.7)
- hashie (3.5.6)
+ hashie (4.1.0)
hike (1.2.3)
http-cookie (1.0.2)
domain_name (~> 0.5)
@@ -192,7 +183,7 @@ GEM
railties (>= 3.1.0)
turbolinks
json (1.8.6)
- jwt (1.5.6)
+ jwt (2.2.2)
kaminari (1.2.1)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.2.1)
@@ -228,7 +219,7 @@ GEM
multi_json (1.15.0)
multi_test (0.1.2)
multi_xml (0.6.0)
- multipart-post (2.0.0)
+ multipart-post (2.1.1)
mysql2 (0.4.10)
net-scp (1.2.1)
net-ssh (>= 2.6.5)
@@ -236,20 +227,23 @@ GEM
netrc (0.11.0)
nokogiri (1.10.10)
mini_portile2 (~> 2.4.0)
- oauth2 (1.4.0)
- faraday (>= 0.8, < 0.13)
- jwt (~> 1.0)
+ oauth2 (1.4.4)
+ faraday (>= 0.8, < 2.0)
+ jwt (>= 1.0, < 3.0)
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
octokit (4.7.0)
sawyer (~> 0.8.0, >= 0.5.3)
- omniauth (1.7.1)
- hashie (>= 3.4.6, < 3.6.0)
+ omniauth (1.9.1)
+ hashie (>= 3.4.6)
rack (>= 1.6.2, < 3)
- omniauth-oauth2 (1.4.0)
- oauth2 (~> 1.0)
- omniauth (~> 1.2)
+ omniauth-github (1.4.0)
+ omniauth (~> 1.5)
+ omniauth-oauth2 (>= 1.4.0, < 2.0)
+ omniauth-oauth2 (1.7.0)
+ oauth2 (~> 1.4)
+ omniauth (~> 1.9)
orm_adapter (0.5.0)
public_suffix (3.0.1)
rack (1.6.13)
@@ -283,9 +277,9 @@ GEM
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (13.0.1)
- rbnacl (3.4.0)
+ rbnacl (7.1.1)
ffi
- rbnacl-libsodium (1.0.11)
+ rbnacl-libsodium (1.0.16)
rbnacl (>= 3.0.1)
rdoc (4.1.1)
json (~> 1.4)
@@ -417,12 +411,12 @@ DEPENDENCIES
money-tree (~> 0.10.0)
mysql2 (~> 0.4.10)
octokit (~> 4.7.0)
- omniauth (~> 1.7.1)
- omniauth-github!
+ omniauth (~> 1.9.1)
+ omniauth-github
rails (= 4.2.11.3)
rails-i18n (~> 4.0.0)
- rbnacl (~> 3.4.0)
- rbnacl-libsodium (~> 1.0.0)
+ rbnacl
+ rbnacl-libsodium
render_csv
rest-client
rspec-activemodel-mocks
From 26235b8a65e1c686c8838d7b140b64876d02c10f Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 8 Nov 2020 12:26:28 +0100
Subject: [PATCH 047/159] rbnacl < 5 is needed. also removed libsodium
---
Gemfile | 3 +--
Gemfile.lock | 7 ++-----
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/Gemfile b/Gemfile
index 258f2ad1..6734f12f 100644
--- a/Gemfile
+++ b/Gemfile
@@ -51,8 +51,7 @@ group :development do
# add ed25519 support to net-ssh
gem 'bcrypt_pbkdf', '~> 1.0.0'
- gem 'rbnacl'
- gem 'rbnacl-libsodium'
+ gem 'rbnacl', '< 5'
end
group :development, :test do
diff --git a/Gemfile.lock b/Gemfile.lock
index f1dfdcf5..fecf9a8a 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -277,10 +277,8 @@ GEM
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (13.0.1)
- rbnacl (7.1.1)
+ rbnacl (4.0.2)
ffi
- rbnacl-libsodium (1.0.16)
- rbnacl (>= 3.0.1)
rdoc (4.1.1)
json (~> 1.4)
redis (3.3.0)
@@ -415,8 +413,7 @@ DEPENDENCIES
omniauth-github
rails (= 4.2.11.3)
rails-i18n (~> 4.0.0)
- rbnacl
- rbnacl-libsodium
+ rbnacl (< 5)
render_csv
rest-client
rspec-activemodel-mocks
From 0bb26c649babf909fcaddad599705e29b5e98e95 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Fri, 13 Nov 2020 12:12:31 +0100
Subject: [PATCH 048/159] Fixed signing up with github
---
app/controllers/users/omniauth_callbacks_controller.rb | 8 ++++----
app/models/user.rb | 3 ++-
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/app/controllers/users/omniauth_callbacks_controller.rb b/app/controllers/users/omniauth_callbacks_controller.rb
index ebefbc65..22f49a51 100644
--- a/app/controllers/users/omniauth_callbacks_controller.rb
+++ b/app/controllers/users/omniauth_callbacks_controller.rb
@@ -3,15 +3,15 @@ class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
def github
@user = User.find_by(nickname: @omniauth_info.nickname) ||
- User.find_by(email: @omniauth_info.verified_emails)
+ User.find_by(email: @omniauth_info.email)
if @user.present?
- if @omniauth_info.primary_email.present? && @user.email != @omniauth_info.primary_email
+ if @omniauth_info.email.present? && @user.email != @omniauth_info.email
# update email if it has been changed
- @user.update email: @omniauth_info.primary_email
+ @user.update email: @omniauth_info.email
end
else # user not found
- if @omniauth_info.primary_email.present?
+ if @omniauth_info.email.present?
@user = User.create_with_omniauth!(@omniauth_info)
else
set_flash_message(:error, :failure, kind: 'GitHub', reason: I18n.t('devise.errors.primary_email'))
diff --git a/app/models/user.rb b/app/models/user.rb
index 220b1781..839b6d7e 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -63,9 +63,10 @@ def self.update_cache
def self.create_with_omniauth!(auth_info)
generated_password = Devise.friendly_token.first(Devise.password_length.min)
create do |user|
- user.email = auth_info.primary_email
+ user.email = auth_info.email
user.password = generated_password
user.nickname = auth_info.nickname
+ user.display_name = auth_info.name
user.skip_confirmation!
end
end
From a6ad6f5437dfb020f3076cbcb6adb2275faae586 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sat, 14 Nov 2020 11:20:49 +0100
Subject: [PATCH 049/159] allow to delete accounts
---
app/assets/javascripts/i18n/translations.js | 2 +-
app/controllers/users_controller.rb | 9 +
app/views/users/show.html.haml | 9 +
config/locales/en.yml | 5 +
config/routes.rb | 2 +-
...delete_account_button_in_their_profile.yml | 211 +++++++++
...ount_by_entering_correct_email_address.yml | 419 ++++++++++++++++++
features/delete_user.feature | 30 ++
features/step_definitions/users_steps.rb | 8 +
9 files changed, 693 insertions(+), 2 deletions(-)
create mode 100644 features/cassettes/Users_should_be_able_to_delete_their_accounts/Users_should_be_able_to_see_delete_account_button_in_their_profile.yml
create mode 100644 features/cassettes/Users_should_be_able_to_delete_their_accounts/Users_should_confirm_deleting_account_by_entering_correct_email_address.yml
create mode 100644 features/delete_user.feature
diff --git a/app/assets/javascripts/i18n/translations.js b/app/assets/javascripts/i18n/translations.js
index 3831e702..81559ce8 100644
--- a/app/assets/javascripts/i18n/translations.js
+++ b/app/assets/javascripts/i18n/translations.js
@@ -1,2 +1,2 @@
var I18n = I18n || {};
-I18n.translations = {"en":{"js":{"errors":{"value":{"invalid":"Value is invalid"},"email":{"invalid":"Invalid Email Address","blank":"The Email is required and can't be empty"},"password":{"blank":"The password is required and can't be empty","invalid":"The password and its confirmation are not same"},"password_confirmation":{"blank":"The password confirmation is required and can't be empty","invalid":"The password and its confirmation are not same"}}}},"fr":{"js":{"errors":{"value":{"invalid":"Valeur non valide"},"email":{"invalid":"Adresse Email non valide","blank":"L'Email est requis et doit être renseigné"},"password":{"blank":"Les mot de passe est requis et doit être renseigné","invalid":"Le mot de passe et sa confirmation ne sont pas identiques"},"password_confirmation":{"blank":"La confirmation du mot de passe est requise et doit être renseignée","invalid":"Le mot de passe et sa confirmation ne sont pas identiques"}}}},"hr":{"js":{"errors":{"value":{"invalid":"Neispravna vrijednost"},"email":{"invalid":"Neispravna email adresa","blank":"Email je obavezan"},"password":{"blank":"Lozinka je obavezma","invalid":"Lozinka i potvrda nisu isti"},"password_confirmation":{"blank":"Potvrda lozinke je obavezna","invalid":"Lozinka i potvrda nisu isti"}}}},"nl":{"js":{"errors":{"value":{"invalid":"De waarde is ongeldig"},"email":{"invalid":"Ongeldig e-mail adres","blank":"E-mail is verplicht en kan niet leeg blijven"},"password":{"blank":"Wachtwoord is verplicht en kan niet leeg blijven","invalid":"De wachtwoorden komen niet overeen"},"password_confirmation":{"blank":"Wachtwoord is verplicht en kan niet leeg blijven","invalid":"De wachtwoorden komen niet overeen"}}}},"pl":{"js":{"errors":{"value":{"invalid":"Wartość jest niepoprawna"},"email":{"invalid":"Błędny adres E-mail","blank":"E-mail jest wymagany i nie może być pusty"},"password":{"blank":"HasÅ‚o jest wymagane i nie może być puste","invalid":"HasÅ‚o i jego potwierdzenie nie sÄ… takie same"},"password_confirmation":{"blank":"Potwierdzenie hasÅ‚a jest wymagane i nie może być puste","invalid":"HasÅ‚o i jego potwierdzenie nie sÄ… takie same"}}}},"ru":{"js":{"errors":{"value":{"invalid":"Ðеверное значение"},"email":{"invalid":"Ошибка в адреÑе Ñлектронной почты","blank":"ÐÐ´Ñ€ÐµÑ Ñлектронной почты не может быть пуÑтым"},"password":{"blank":"Пароль не может быть пуÑтым","invalid":"Пароль и его подтверждение не Ñовпадают"},"password_confirmation":{"blank":"Подтверждение Ð¿Ð°Ñ€Ð¾Ð»Ñ Ð½Ðµ может быть пуÑтым","invalid":"Пароль и его подтверждение не Ñовпадают"}}}}};
\ No newline at end of file
+I18n.translations = {"en":{"js":{"errors":{"value":{"invalid":"Value is invalid"},"email":{"invalid":"Invalid Email Address","blank":"The Email is required and can't be empty"},"password":{"blank":"The password is required and can't be empty","invalid":"The password and its confirmation are not same"},"password_confirmation":{"blank":"The password confirmation is required and can't be empty","invalid":"The password and its confirmation are not same"}}}},"de":{"js":{"errors":{"value":{"invalid":"Der Wert ist ungültig."},"email":{"invalid":"Die E-Mail Adresse ist ungültig.","blank":"Sie müssen eine E-Mail Adresse angeben!"},"password":{"blank":"Sie müssen ein Passwort angeben!","invalid":"Die angegebenen Passwörter stimmen nicht überein!"},"password_confirmation":{"blank":"Sie müssen ihr Passwort bestätigen.","invalid":"Die angegebenen Passwörter stimmen nicht überein!"}}}},"pt":{"js":{"errors":{"value":{"invalid":"Valor é invalido"},"email":{"invalid":"Endereço de Email inválido","blank":"O Email é necessário e não pode ser vazio"},"password":{"blank":"A senha é necessária e não pode ser vazia","invalid":"A senha e a sua confirmação não são iguais"},"password_confirmation":{"blank":"A confirmação da senha é necessária e não pode ser vazia","invalid":"A senha e a sua confirmação não são iguais"}}}},"my":{"js":{"errors":{"value":{"invalid":"Nilai tidak sah"},"email":{"invalid":"Alamat e-mel tidak sah","blank":"E-mel diperlukan dan tidak boleh kosong"},"password":{"blank":"Kata laluan diperlukan dan tidak boleh kosong","invalid":"Kata laluan dan pengesahannya tidak sama"},"password_confirmation":{"blank":"Pengesahan kata laluan diperlukan dan tidak boleh kosong","invalid":"Kata laluan dan pengesahannya tidak sama"}}}},"ru":{"js":{"errors":{"value":{"invalid":"Ðеверное значение"},"email":{"invalid":"Ошибка в адреÑе Ñлектронной почты","blank":"ÐÐ´Ñ€ÐµÑ Ñлектронной почты не может быть пуÑтым"},"password":{"blank":"Пароль не может быть пуÑтым","invalid":"Пароль и его подтверждение не Ñовпадают"},"password_confirmation":{"blank":"Подтверждение Ð¿Ð°Ñ€Ð¾Ð»Ñ Ð½Ðµ может быть пуÑтым","invalid":"Пароль и его подтверждение не Ñовпадают"}}}},"ja":{"js":{"errors":{"value":{"invalid":"値ãŒä¸æ£ã§ã™ã€‚"},"email":{"invalid":"䏿£ãªãƒ¡ãƒ¼ãƒ«ã‚¢ãƒ‰ãƒ¬ã‚¹ã§ã™ã€‚","blank":"メールアドレスã¯å¿…é ˆã§ã™ã€‚"},"password":{"blank":"パスワードã¯å¿…é ˆã§ã™ã€‚","invalid":"パスワードã¨ãƒ‘スワード確èªãŒä¸€è‡´ã—ã¾ã›ã‚“。"},"password_confirmation":{"blank":"パスワード確èªã¯å¿…é ˆã§ã™ã€‚","invalid":"パスワードã¨ãƒ‘スワード確èªãŒä¸€è‡´ã—ã¾ã›ã‚“。"}}}},"id":{"js":{"errors":{"value":{"invalid":"Nilai tidak valid"},"email":{"invalid":"Alamat email tidak valid","blank":"Email harus diisi dan tidak boleh kosong"},"password":{"blank":"Password harus diisi dan tidak boleh kosong","invalid":"Password tidak sama"},"password_confirmation":{"blank":"Password konfirmasi harus diisi dan tidak boleh kosong","invalid":"Password tidak sama"}}}},"nl":{"js":{"errors":{"value":{"invalid":"De waarde is ongeldig"},"email":{"invalid":"Ongeldig e-mail adres","blank":"E-mail is verplicht en kan niet leeg blijven"},"password":{"blank":"Wachtwoord is verplicht en kan niet leeg blijven","invalid":"De wachtwoorden komen niet overeen"},"password_confirmation":{"blank":"Wachtwoord is verplicht en kan niet leeg blijven","invalid":"De wachtwoorden komen niet overeen"}}}},"es":{"js":{"errors":{"value":{"invalid":"Valor no válido."},"email":{"invalid":"Correo electrónico no válido.","blank":"El correo electrónico es requerido y no puede dejarlo en blanco."},"password":{"blank":"La contraseña es requerida y no puede dejarlo en blanco.","invalid":"Su contraseña no es igual a la contraseña de confirmación."},"password_confirmation":{"blank":"La contraseña de confirmación es requerida y no puede dejarlo en blanco.","invalid":"Su contraseña no es igual a la contraseña de confirmación."}}}},"ro":{"js":{"errors":{"value":{"invalid":"Valoarea este invalidă"},"email":{"invalid":"Adresă de email invalidă","blank":"E-mail este necesară È™i nu poate fi gol"},"password":{"blank":"Parola este necesară È™i nu poate fi goală","invalid":"Parola È™i confirmarea acesteia nu sunt aceleaÈ™i"},"password_confirmation":{"blank":"Confirmarea parolei este necesară È™i nu poate fi goală","invalid":"Parola È™i confirmarea acesteia nu sunt aceleaÈ™i"}}}},"fr":{"js":{"errors":{"value":{"invalid":"Valeur non valide"},"email":{"invalid":"Adresse Email non valide","blank":"L'adresse Email est requise et doit être renseignée"},"password":{"blank":"Le mot de passe est requis et doit être renseigné","invalid":"Le mot de passe et sa confirmation ne sont pas identiques"},"password_confirmation":{"blank":"La confirmation du mot de passe est requise et doit être renseignée","invalid":"Le mot de passe et sa confirmation ne sont pas identiques"}}}},"ko":{"js":{"errors":{"value":{"invalid":"ê°’ì´ ì˜¬ë°”ë¥´ì§€ 않습니다."},"email":{"invalid":"ì´ë©”ì¼ ì£¼ì†Œê°€ 명확하지 않습니다.","blank":"ì´ë©”ì¼ ì£¼ì†ŒëŠ” 반드시 ìž…ë ¥ë˜ì–´ì•¼ 합니다."},"password":{"blank":"비밀번호는 반드시 ìž…ë ¥ë˜ì–´ì•¼ 합니다.","invalid":"비밀번호 확ì¸ëž€ì´ 비밀번호와 ì¼ì¹˜í•˜ì§€ 않습니다."},"password_confirmation":{"blank":"비밀번호 확ì¸ëž€ì€ 반드시 ìž…ë ¥ë˜ì–´ì•¼ 합니다.","invalid":"비밀번호 확ì¸ëž€ì´ 비밀번호와 ì¼ì¹˜í•˜ì§€ 않습니다."}}}},"hr":{"js":{"errors":{"value":{"invalid":"Neispravna vrijednost"},"email":{"invalid":"Neispravna email adresa","blank":"Email je obavezan"},"password":{"blank":"Lozinka je obavezna","invalid":"Lozinka i potvrda nisu iste"},"password_confirmation":{"blank":"Potvrda lozinke je obavezna","invalid":"Lozinka i potvrda nisu iste"}}}},"pl":{"js":{"errors":{"value":{"invalid":"Wartość jest niepoprawna"},"email":{"invalid":"Błędny adres E-mail","blank":"E-mail jest wymagany i nie może być pusty"},"password":{"blank":"HasÅ‚o jest wymagane i nie może być puste","invalid":"HasÅ‚o i jego potwierdzenie nie sÄ… takie same"},"password_confirmation":{"blank":"Potwierdzenie hasÅ‚a jest wymagane i nie może być puste","invalid":"HasÅ‚o i jego potwierdzenie nie sÄ… takie same"}}}},"cn":{"js":{"errors":{"value":{"invalid":"æ•°å€¼æ— æ•ˆ"},"email":{"invalid":"æ— æ•ˆç”µå邮箱地å€","blank":"电å邮箱地å€ä¸ºå¿…填且ä¸èƒ½ä¸ºç©º"},"password":{"blank":"密ç 为必填且ä¸èƒ½ä¸ºç©º","invalid":"密ç 和确认密ç ä¸ç›¸åŒ"},"password_confirmation":{"blank":"确认密ç 为必填且ä¸èƒ½ä¸ºç©º","invalid":"密ç 和确认密ç ä¸ç›¸åŒ"}}}},"hk":{"js":{"errors":{"value":{"invalid":"數值無效"},"email":{"invalid":"無效電å郵箱地å€","blank":"é›»å郵箱地å€ç‚ºå¿…填且ä¸èƒ½ç‚ºç©º"},"password":{"blank":"密碼為必填且ä¸èƒ½ç‚ºç©º","invalid":"密碼和確èªå¯†ç¢¼ä¸ç›¸åŒ"},"password_confirmation":{"blank":"確èªå¯†ç¢¼ç‚ºå¿…填且ä¸èƒ½ç‚ºç©º","invalid":"密碼和確èªå¯†ç¢¼ä¸ç›¸åŒ"}}}}};
\ No newline at end of file
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 57d67b1a..db3258a6 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -34,6 +34,15 @@ def login
end
end
+ def destroy
+ if params[:user][:email] == @user.email
+ sign_out(current_user)
+ @user.destroy
+ redirect_to root_url, notice: I18n.t('notices.account_deleted')
+ else
+ redirect_to @user, alert: I18n.t('errors.invalid_email')
+ end
+ end
private
diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml
index e4710db2..aaebe840 100644
--- a/app/views/users/show.html.haml
+++ b/app/views/users/show.html.haml
@@ -45,3 +45,12 @@
= f.password_field :password, autofocus: true, autocomplete: "off"
= f.password_field :password_confirmation, autocomplete: "off"
= f.submit t('.submit_password')
+
+%br
+%p
+ %strong= link_to t('.delete_account'), '#delete_user_form', data: {toggle: "collapse"}
+
+= twitter_bootstrap_form_for @user, html: {class: (params[:delete_user] ? '' : 'collapse'), id: 'delete_user_form', method: 'DELETE'} do |f|
+ %p= t('.delete_account_notice')
+ = f.text_field :email, value: '', autocomplete: "off"
+ = f.submit t('.delete_account_confirm'), class: 'btn-danger'
\ No newline at end of file
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 7411f4f0..cb95b3d3 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -25,11 +25,13 @@ en:
wrong_bitcoin_address: Error updating bitcoin address
user_not_found: User not found
access_denied: You are not authorized to perform this action!
+ invalid_email: Invalid email
notices:
project_updated: The project settings have been updated
tips_decided: The tip amounts have been defined
user_updated: Your information saved!
user_unsubscribed: "You unsubscribed! Sorry for bothering you. Although, you can still leave us your bitcoin address to get your tips."
+ account_deleted: Your account was deleted
tip_amounts:
undecided: "Undecided"
free: "Free: 0%"
@@ -176,6 +178,9 @@ en:
change_password: Change your password
submit_password: Change my password
use_from_gravatar: Use from your gravatar profile
+ delete_account: Delete Account
+ delete_account_notice: Enter your bitcoin address and click the button below to delete your account. This account will be gone forever, but you will still be able to sign up with the same github account. Please be certain.
+ delete_account_confirm: Delete this account!
withdrawals:
index:
title: Last Withdrawals
diff --git a/config/routes.rb b/config/routes.rb
index 5ec9d7a1..11af549b 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -22,7 +22,7 @@
resources :tips , :only => [:index]
resources :deposits , :only => [:index]
resources :withdrawals , :only => [:index]
- resources :users , :only => [:index , :show , :update]
+ resources :users , :only => [:index , :show , :update, :destroy]
resources :projects , :only => [:index , :show , :update , :edit ] do
collection do
get 'search'
diff --git a/features/cassettes/Users_should_be_able_to_delete_their_accounts/Users_should_be_able_to_see_delete_account_button_in_their_profile.yml b/features/cassettes/Users_should_be_able_to_delete_their_accounts/Users_should_be_able_to_see_delete_account_button_in_their_profile.yml
new file mode 100644
index 00000000..13169f9d
--- /dev/null
+++ b/features/cassettes/Users_should_be_able_to_delete_their_accounts/Users_should_be_able_to_see_delete_account_button_in_their_profile.yml
@@ -0,0 +1,211 @@
+---
+http_interactions:
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Sun, 08 Nov 2020 12:35:20 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Sun, 08 Nov 2020 12:35:20 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Sun, 08 Nov 2020 12:35:22 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Sun, 08 Nov 2020 12:35:23 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Sun, 08 Nov 2020 12:35:23 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Sun, 08 Nov 2020 12:35:23 GMT
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Sun, 08 Nov 2020 12:35:23 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Sun, 08 Nov 2020 12:35:23 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Sun, 08 Nov 2020 12:35:24 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Sun, 08 Nov 2020 12:35:24 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Sun, 08 Nov 2020 12:35:24 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Sun, 08 Nov 2020 12:35:25 GMT
+recorded_with: VCR 3.0.3
diff --git a/features/cassettes/Users_should_be_able_to_delete_their_accounts/Users_should_confirm_deleting_account_by_entering_correct_email_address.yml b/features/cassettes/Users_should_be_able_to_delete_their_accounts/Users_should_confirm_deleting_account_by_entering_correct_email_address.yml
new file mode 100644
index 00000000..b1db9a68
--- /dev/null
+++ b/features/cassettes/Users_should_be_able_to_delete_their_accounts/Users_should_confirm_deleting_account_by_entering_correct_email_address.yml
@@ -0,0 +1,419 @@
+---
+http_interactions:
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Sat, 14 Nov 2020 09:31:42 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Sat, 14 Nov 2020 09:31:42 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Sat, 14 Nov 2020 09:31:42 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Sat, 14 Nov 2020 09:31:42 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Sat, 14 Nov 2020 09:31:42 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Sat, 14 Nov 2020 09:31:43 GMT
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Sat, 14 Nov 2020 09:31:43 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Sat, 14 Nov 2020 09:31:43 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Sat, 14 Nov 2020 09:31:43 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Sat, 14 Nov 2020 09:31:43 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Sat, 14 Nov 2020 09:31:43 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Sat, 14 Nov 2020 09:31:44 GMT
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Sat, 14 Nov 2020 09:31:44 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Sat, 14 Nov 2020 09:31:44 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Sat, 14 Nov 2020 09:31:44 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Sat, 14 Nov 2020 09:31:45 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Sat, 14 Nov 2020 09:31:45 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Sat, 14 Nov 2020 09:31:45 GMT
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Sat, 14 Nov 2020 09:31:45 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Sat, 14 Nov 2020 09:31:45 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Sat, 14 Nov 2020 09:31:45 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Sat, 14 Nov 2020 09:31:46 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Sat, 14 Nov 2020 09:31:46 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Sat, 14 Nov 2020 09:31:46 GMT
+recorded_with: VCR 3.0.3
diff --git a/features/delete_user.feature b/features/delete_user.feature
new file mode 100644
index 00000000..9517fe42
--- /dev/null
+++ b/features/delete_user.feature
@@ -0,0 +1,30 @@
+Feature: Users should be able to delete their accounts
+ Background:
+ Given a developer named "seldon" exists without a bitcoin address
+ And I'm signed in as "seldon"
+
+ @vcr-ignore-params
+ Scenario: Users should be able to see delete account button in their profile
+ Given I visit the "seldon user" page
+ Then I should see "Delete Account"
+ When I click "Delete Account"
+ When I fill "E-mail" with: "seldon@example.com"
+ When I click "Delete this account!"
+ Then I should be on the "home" page
+ And I should see "Your account was deleted"
+ And a developer named "seldon" does not exist
+ And I should see "Sign in" in the "header" area
+ And I should not see "Sign out" in the "header" area
+
+ @vcr-ignore-params
+ Scenario: Users should confirm deleting account by entering correct email address
+ Given I visit the "seldon user" page
+ Then I should see "Delete Account"
+ When I click "Delete Account"
+ When I fill "E-mail" with: "invalid@example.com"
+ When I click "Delete this account!"
+ Then I should be on the "seldon user" page
+ And I should see "Invalid email"
+ And a developer named "seldon" exists
+ And I should see "Sign out" in the "header" area
+ And I should not see "Sign in" in the "header" area
\ No newline at end of file
diff --git a/features/step_definitions/users_steps.rb b/features/step_definitions/users_steps.rb
index 91ee12f3..1a700918 100644
--- a/features/step_definitions/users_steps.rb
+++ b/features/step_definitions/users_steps.rb
@@ -13,3 +13,11 @@ def create_user nickname , has_bitcoiin_address
Given /^a developer named "(.*?)" exists (with|without?) a bitcoin address$/ do |nickname , with|
(@users ||= {})[nickname] ||= (create_user nickname , (with.eql? 'with'))
end
+
+Then /^a developer named "(.*?)" does not exist$/ do |nickname|
+ User.where(nickname: nickname).first.should be_nil
+end
+
+Then /^a developer named "(.*?)" exists$/ do |nickname|
+ User.where(nickname: nickname).first.should_not be_nil
+end
From 9928b06bcd5ca2a89f45f477dea59f0beb77d738 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sat, 14 Nov 2020 11:47:45 +0100
Subject: [PATCH 050/159] typo
---
config/locales/en.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/locales/en.yml b/config/locales/en.yml
index cb95b3d3..969ae7ff 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -179,7 +179,7 @@ en:
submit_password: Change my password
use_from_gravatar: Use from your gravatar profile
delete_account: Delete Account
- delete_account_notice: Enter your bitcoin address and click the button below to delete your account. This account will be gone forever, but you will still be able to sign up with the same github account. Please be certain.
+ delete_account_notice: Enter your email address and click the button below to delete your account. This account will be gone forever, but you will still be able to sign up with the same github account. Please be certain.
delete_account_confirm: Delete this account!
withdrawals:
index:
From fbd3737dddfa54b24abd848bd5caeda42ca1bba0 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sat, 14 Nov 2020 11:48:00 +0100
Subject: [PATCH 051/159] added missing traslations
---
config/locales/ru.yml | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/config/locales/ru.yml b/config/locales/ru.yml
index 462f610f..d01c82a5 100644
--- a/config/locales/ru.yml
+++ b/config/locales/ru.yml
@@ -26,12 +26,14 @@ ru:
user_not_found: Пользователь не найден
access_denied: Ð’Ñ‹ не авторизованы Ð´Ð»Ñ Ð²Ñ‹Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¸Ñ Ð´Ð°Ð½Ð½Ð¾Ð³Ð¾ дейÑтвиÑ!
opt_in_notice: "Ð’ ÑвÑзи Ñ Ð¼Ð½Ð¾Ð³Ð¾Ñ‡Ð¸Ñленными жалобами мы более не добавлÑем проекты автоматичеÑки. СущеÑтвующие проекты, не получившие пожертвований, были удалены. ЕÑли Ð’Ñ‹ хотите добавить Ñвой проект, пожалуйÑта, %{create_issue_link}."
+ invalid_email: Ðеверный Ð°Ð´Ñ€ÐµÑ Ñлеткронной почты
notices:
project_updated: ÐаÑтройки проекта обновлены
tips_decided: Сумма Ð²Ð¾Ð·Ð½Ð°Ð³Ñ€Ð°Ð¶Ð´ÐµÐ½Ð¸Ñ Ð¾Ð¿Ñ€ÐµÐ´ÐµÐ»ÐµÐ½Ð°
user_updated: Ваш профиль обновлен!
user_unsubscribed: "Ð’Ñ‹ отпиÑалиÑÑŒ! ПриноÑим Ð¸Ð·Ð²Ð¸Ð½ÐµÐ½Ð¸Ñ Ð·Ð° предоÑтавленные неудобÑтва. Однако, вы вÑе равно можете оÑтавить нам Ñвой Биткоин-адреÑ, чтобы получать вознаграждениÑ"
+ account_deleted: Ваш аккаунт был удален
tip_amounts:
undecided: "Ðе определено"
free: "Ðет: 0%"
@@ -177,6 +179,10 @@ ru:
submit_user: Обновить информацию пользователÑ
change_password: Смена паролÑ
submit_password: Сменить пароль
+ use_from_gravatar: ИÑпользовать Gravatar
+ delete_account: Удаление аккаунта
+ delete_account_notice: Введите ваш Ð°Ð´Ñ€ÐµÑ Ñлектронной почты и нажмите на кнопку ниже чтобы удалить Ñвой аккаунт. Ðтот аккаунт будет удален навÑегда, но вы Ñможете зарегиÑтрироватьÑÑ Ñнова иÑÐ¿Ð¾Ð»ÑŒÐ·ÑƒÑ Ð²Ð°Ñˆ github аккаунт. ПожалуйÑта, будьте уверенны в том что вы делаете.
+ delete_account_confirm: Удалить Ñтот аккаунт!
withdrawals:
index:
title: ПоÑледние выплаты
From 1e8d80a91c022180c4ae43d7ca7da27a94ad4fcc Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sat, 14 Nov 2020 21:54:57 +0100
Subject: [PATCH 052/159] Updated ruby, devise, and cucumber
---
.travis.yml | 2 +-
Gemfile | 8 +-
Gemfile.lock | 75 +++++++++++--------
app/views/devise/registrations/edit.html.haml | 2 +-
app/views/devise/registrations/new.html.haml | 2 +-
app/views/devise/sessions/new.html.haml | 2 +-
config/application.rb | 2 +
config/cucumber.yml | 4 +-
features/pretty_paths.feature | 8 +-
features/sign_up_sign_in.feature | 10 +--
features/step_definitions/common.rb | 2 +-
features/step_definitions/project_steps.rb | 2 -
features/support/env.rb | 2 +-
spec/spec_helper.rb | 2 +-
14 files changed, 68 insertions(+), 55 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index e3edf7f1..4119a1d6 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,7 +6,7 @@ git:
depth: 10
rvm:
- - 2.4.9
+ - 2.5.8
bundler_args: --without development --jobs=9 --retry=2 --quiet
diff --git a/Gemfile b/Gemfile
index 6734f12f..bea3b02d 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,6 +1,6 @@
source 'https://rubygems.org'
-ruby '2.4.9'
+ruby '2.5.8'
gem 'rails', '4.2.11.3'
@@ -11,7 +11,7 @@ gem 'bootstrap_form', github: 'bootstrap-ruby/rails-bootstrap-forms'
gem 'cancancan'
gem 'coffee-rails', '~> 4.0.0'
gem 'demoji'
-gem 'devise', '~> 3.5.2'
+gem 'devise', '~> 4.7.3'
gem 'devise-i18n'
gem 'dusen', '~> 0.6.1'
gem 'easy_gravatar'
@@ -61,10 +61,10 @@ group :development, :test do
end
group :test do
- gem 'cucumber-rails', require: false
+ gem 'cucumber-rails', '~> 1.0', require: false
gem 'database_cleaner'
gem 'rspec-activemodel-mocks'
- gem 'shoulda-matchers', '~> 3.1'
+ gem 'shoulda-matchers', '~> 3.1'
gem 'simplecov'
gem 'vcr'
gem 'webmock'
diff --git a/Gemfile.lock b/Gemfile.lock
index fecf9a8a..f0d9f9c0 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -74,6 +74,7 @@ GEM
builder
multi_json
arel (6.0.4)
+ backports (3.18.2)
bcrypt (3.1.16)
bcrypt_pbkdf (1.0.0)
builder (3.2.4)
@@ -91,12 +92,14 @@ GEM
capistrano-rvm (0.1.2)
capistrano (~> 3.0)
sshkit (~> 1.2)
- capybara (2.5.0)
- mime-types (>= 1.16)
- nokogiri (>= 1.3.3)
- rack (>= 1.0.0)
- rack-test (>= 0.5.4)
- xpath (~> 2.0)
+ capybara (3.33.0)
+ addressable
+ mini_mime (>= 0.1.3)
+ nokogiri (~> 1.8)
+ rack (>= 1.6.0)
+ rack-test (>= 0.6.3)
+ regexp_parser (~> 1.5)
+ xpath (~> 3.2)
coffee-rails (4.0.1)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.0)
@@ -110,29 +113,38 @@ GEM
crack (0.4.3)
safe_yaml (~> 1.0.0)
crass (1.0.6)
- cucumber (1.3.20)
+ cucumber (3.2.0)
builder (>= 2.1.2)
- diff-lcs (>= 1.1.3)
- gherkin (~> 2.12)
+ cucumber-core (~> 3.2.0)
+ cucumber-expressions (~> 6.0.1)
+ cucumber-wire (~> 0.0.1)
+ diff-lcs (~> 1.3)
+ gherkin (~> 5.1.0)
multi_json (>= 1.7.5, < 2.0)
multi_test (>= 0.1.2)
- cucumber-rails (1.4.2)
- capybara (>= 1.1.2, < 3)
- cucumber (>= 1.3.8, < 2)
- mime-types (>= 1.16, < 3)
- nokogiri (~> 1.5)
- rails (>= 3, < 5)
- database_cleaner (1.2.0)
+ cucumber-core (3.2.1)
+ backports (>= 3.8.0)
+ cucumber-tag_expressions (~> 1.1.0)
+ gherkin (~> 5.0)
+ cucumber-expressions (6.0.1)
+ cucumber-rails (1.8.0)
+ capybara (>= 2.12, < 4)
+ cucumber (>= 3.0.2, < 4)
+ mime-types (>= 2.0, < 4)
+ nokogiri (~> 1.8)
+ railties (>= 4.2, < 7)
+ cucumber-tag_expressions (1.1.1)
+ cucumber-wire (0.0.1)
+ database_cleaner (1.8.5)
demoji (0.0.5)
- devise (3.5.2)
+ devise (4.7.3)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
- railties (>= 3.2.6, < 5)
+ railties (>= 4.1.0)
responders
- thread_safe (~> 0.1)
warden (~> 1.2.3)
devise-i18n (0.11.0)
- diff-lcs (1.3)
+ diff-lcs (1.4.4)
docile (1.1.5)
domain_name (0.5.25)
unf (>= 0.0.5, < 1.0.0)
@@ -152,8 +164,7 @@ GEM
faraday (0.17.3)
multipart-post (>= 1.2, < 3)
ffi (1.13.1)
- gherkin (2.12.2)
- multi_json (~> 1.3)
+ gherkin (5.1.0)
globalid (0.4.2)
activesupport (>= 4.2.0)
haml (4.0.5)
@@ -283,10 +294,12 @@ GEM
json (~> 1.4)
redis (3.3.0)
ref (2.0.0)
+ regexp_parser (1.8.2)
render_csv (2.0.0)
rails (>= 3.0)
- responders (2.1.0)
- railties (>= 4.2.0, < 5)
+ responders (2.4.1)
+ actionpack (>= 4.2.0, < 6.0)
+ railties (>= 4.2.0, < 6.0)
rest-client (1.8.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 3.0)
@@ -356,7 +369,7 @@ GEM
tilt (1.4.1)
turbolinks (2.5.3)
coffee-rails
- tzinfo (1.2.7)
+ tzinfo (1.2.8)
thread_safe (~> 0.1)
uglifier (2.4.0)
execjs (>= 0.3.0)
@@ -365,14 +378,14 @@ GEM
unf_ext
unf_ext (0.0.7.1)
vcr (3.0.3)
- warden (1.2.3)
+ warden (1.2.7)
rack (>= 1.0)
webmock (3.1.0)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff
- xpath (2.0.0)
- nokogiri (~> 1.3)
+ xpath (3.2.0)
+ nokogiri (~> 1.8)
PLATFORMS
ruby
@@ -389,10 +402,10 @@ DEPENDENCIES
capistrano-rails (~> 1.1.0)
capistrano-rvm (~> 0.1.0)
coffee-rails (~> 4.0.0)
- cucumber-rails
+ cucumber-rails (~> 1.0)
database_cleaner
demoji
- devise (~> 3.5.2)
+ devise (~> 4.7.3)
devise-i18n
dusen (~> 0.6.1)
easy_gravatar
@@ -435,7 +448,7 @@ DEPENDENCIES
webmock
RUBY VERSION
- ruby 2.4.9p362
+ ruby 2.5.8p224
BUNDLED WITH
1.17.3
diff --git a/app/views/devise/registrations/edit.html.haml b/app/views/devise/registrations/edit.html.haml
index 3a293c04..84a01fc1 100644
--- a/app/views/devise/registrations/edit.html.haml
+++ b/app/views/devise/registrations/edit.html.haml
@@ -1,7 +1,7 @@
= twitter_bootstrap_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put, class: 'form-devise' }) do |f|
%h2
Edit #{resource_name.to_s.humanize}
- = devise_error_messages!
+ = render "devise/shared/error_messages", resource: resource
= f.email_field :email, :autofocus => true
- if devise_mapping.confirmable? && resource.pending_reconfirmation?
%div
diff --git a/app/views/devise/registrations/new.html.haml b/app/views/devise/registrations/new.html.haml
index c6070f5c..721caa85 100644
--- a/app/views/devise/registrations/new.html.haml
+++ b/app/views/devise/registrations/new.html.haml
@@ -1,6 +1,6 @@
= twitter_bootstrap_form_for(resource, :as => resource_name, :url => registration_path(resource_name), html: { class: 'form-devise registration_form'}) do |f|
%h2= t('.title')
- = devise_error_messages!
+ = render "devise/shared/error_messages", resource: resource
= f.email_field :email, :autofocus => true
= f.password_field :password, :autocomplete => "off"
= f.password_field :password_confirmation, :autocomplete => "off"
diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml
index 0f3ff00b..2d75b67f 100644
--- a/app/views/devise/sessions/new.html.haml
+++ b/app/views/devise/sessions/new.html.haml
@@ -1,5 +1,5 @@
= twitter_bootstrap_form_for(resource, :as => resource_name, :url => session_path(resource_name), html: {class: 'form-devise session_form' }) do |f|
- = devise_error_messages!
+ = render "devise/shared/error_messages", resource: resource
%h2= t('.title')
= f.email_field :email, :autofocus => true
= f.password_field :password, :autocomplete => "off"
diff --git a/config/application.rb b/config/application.rb
index 084a3a97..b91bb912 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -27,6 +27,8 @@ class Application < Rails::Application
config.assets.initialize_on_precompile = true
config.available_locales = %w[en es fr nl ru pl hr de ro ko id ja pt my cn hk]
config.active_job.queue_adapter = :sidekiq
+
+ config.active_record.raise_in_transactional_callbacks = true
end
end
diff --git a/config/cucumber.yml b/config/cucumber.yml
index 19b288df..02aae0a1 100644
--- a/config/cucumber.yml
+++ b/config/cucumber.yml
@@ -1,8 +1,8 @@
<%
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
-std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip"
+std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags 'not @wip'"
%>
default: <%= std_opts %> features
wip: --tags @wip:3 --wip features
-rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
+rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags 'not @wip'
diff --git a/features/pretty_paths.feature b/features/pretty_paths.feature
index 760dcdc2..05dab5fc 100644
--- a/features/pretty_paths.feature
+++ b/features/pretty_paths.feature
@@ -133,8 +133,8 @@ Feature: The site routes pretty paths uniformly
Given I'm signed in as "seldon"
When I visit the "seldon user" page
Then I should be on the "seldon user" page
- And I should see "seldon Balance 0.00000000 Ƀ"
- And I should see "E-mail seldon@example.com"
+ And I should see "seldon\nBalance\n0.00000000 Ƀ"
+ And I should see "E-mail\nseldon@example.com"
And I should see "Bitcoin address"
@vcr
@@ -142,8 +142,8 @@ Feature: The site routes pretty paths uniformly
Given I'm signed in as "seldon"
When I browse to the explicit path "users/seldon"
Then I should be on the "seldon user" page
- And I should see "seldon Balance 0.00000000 Ƀ"
- And I should see "E-mail seldon@example.com"
+ And I should see "seldon\nBalance\n0.00000000 Ƀ"
+ And I should see "E-mail\nseldon@example.com"
And I should see "Bitcoin address"
Scenario: Unknown user tips page user name redirects to users page
diff --git a/features/sign_up_sign_in.feature b/features/sign_up_sign_in.feature
index 5363b3c3..894bbaff 100644
--- a/features/sign_up_sign_in.feature
+++ b/features/sign_up_sign_in.feature
@@ -65,24 +65,24 @@ Feature: Visitors should be able to sign_up and sign_in
Given I'm not signed in
When I visit the "sign_in" page
Then I should be on the "sign_in" page
- And I should see "Sign in E-mail Password Remember me"
+ And I should see "Sign in\nE-mail\nPassword\nRemember me"
When I fill "E-mail" with: "unknown-user@somehost.net"
And I fill "Password" with: "unknown-users-password"
And I click "Sign in"
Then I should be on the "sign_in" page
- And I should see "Invalid email or password"
+ And I should see "Invalid E-mail or password"
When I fill "E-mail" with: "seldon@example.com"
And I fill "Password" with: "incorrect-password"
And I click "Sign in"
Then I should be on the "sign_in" page
- And I should see "Invalid email or password"
+ And I should see "Invalid E-mail or password"
Scenario: Visitors should be able to sign up with an email address
Given I'm not signed in
When I visit the "home" page
When I click "Sign up" within the "header" area
Then I should be on the "sign_up" page
- And I should see "Sign up E-mail Password Password confirmation"
+ And I should see "Sign up\nE-mail\nPassword\nPassword confirmation"
When I fill "E-mail" with: "new-guy@example.com"
And I fill "Password" with: "new-guys-password"
@@ -134,7 +134,7 @@ Feature: Visitors should be able to sign_up and sign_in
When I visit the "sign_in" page
Then I should be on the "sign_in" page
- And I should see "Sign in E-mail Password Remember me"
+ And I should see "Sign in\nE-mail\nPassword\nRemember me"
When I fill "E-mail" with: "new-guy@example.com"
And I fill "Password" with: "new-guys-password"
And I click "Sign in"
diff --git a/features/step_definitions/common.rb b/features/step_definitions/common.rb
index 9f72ab4c..140b071a 100644
--- a/features/step_definitions/common.rb
+++ b/features/step_definitions/common.rb
@@ -140,7 +140,7 @@ def find_element node_name
end
Then(/^I should see "(.*?)"$/) do |arg1|
- page.should have_content(arg1)
+ page.should have_content(arg1.gsub('\n', "\n"))
end
Then(/^I should not see "(.*?)"$/) do |arg1|
diff --git a/features/step_definitions/project_steps.rb b/features/step_definitions/project_steps.rb
index d20573ef..0693a5db 100644
--- a/features/step_definitions/project_steps.rb
+++ b/features/step_definitions/project_steps.rb
@@ -63,8 +63,6 @@ def find_project service , project_name
@current_project = create_github_project project_name , false
else raise "unknown provider \"#{provider}\""
end
-
- step "the project collaborators are:" , (Cucumber::Ast::Table.new [])
end
When /^regarding the "(.*?)" project named "(.*?)"$/ do |provider , project_name|
diff --git a/features/support/env.rb b/features/support/env.rb
index 7b03a8f5..cc01c149 100644
--- a/features/support/env.rb
+++ b/features/support/env.rb
@@ -32,7 +32,7 @@
# Remove/comment out the lines below if your app doesn't have a database.
# For some databases (like MongoDB and CouchDB) you may need to use :truncation instead.
begin
- DatabaseCleaner.strategy = :transaction
+ DatabaseCleaner.strategy = :truncation
rescue NameError
raise 'You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it.'
end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 746f82d0..033570ea 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -56,6 +56,6 @@
config.order = "random"
include FactoryGirl::Syntax::Methods
- config.include Devise::TestHelpers, type: :controller
+ config.include Devise::Test::ControllerHelpers, type: :controller
config.extend ControllerMacros, type: :controller
end
From ca5795493ae3ba34f168a18eb3c2d378f56fc6f6 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sat, 14 Nov 2020 22:23:39 +0100
Subject: [PATCH 053/159] Updated ruby version in the deploy config
---
config/deploy.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/deploy.rb b/config/deploy.rb
index 0a85b48c..932e2754 100644
--- a/config/deploy.rb
+++ b/config/deploy.rb
@@ -7,7 +7,7 @@
set :scm, :git
set :rvm_type, :user
-set :rvm_ruby_version, '2.4.9'
+set :rvm_ruby_version, '2.5.8'
set :rvm_custom_path, '~/.rvm'
set :format, :pretty
From 52418d98410f0510c88a6820b792505aaec2ea48 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 15 Nov 2020 09:38:49 +0100
Subject: [PATCH 054/159] Security fixes: Updated haml, and json
---
Gemfile | 4 +--
Gemfile.lock | 72 +++++++++++++++++++++++++++++-----------------------
2 files changed, 42 insertions(+), 34 deletions(-)
diff --git a/Gemfile b/Gemfile
index bea3b02d..5b0aed9c 100644
--- a/Gemfile
+++ b/Gemfile
@@ -15,7 +15,7 @@ gem 'devise', '~> 4.7.3'
gem 'devise-i18n'
gem 'dusen', '~> 0.6.1'
gem 'easy_gravatar'
-gem 'haml-rails', '~> 0.5.3'
+gem 'haml-rails', '~> 1.0'
gem 'http_accept_language'
gem 'i18n-js'
gem 'jbuilder', '~> 1.5.3'
@@ -56,7 +56,7 @@ end
group :development, :test do
gem 'factory_girl_rails', '~> 4.3.0'
- gem 'rspec-rails', '~> 3.5.0'
+ gem 'rspec-rails', '~> 4.0'
gem 'sqlite3', '~> 1.3.11'
end
diff --git a/Gemfile.lock b/Gemfile.lock
index f0d9f9c0..30498c23 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -145,7 +145,7 @@ GEM
warden (~> 1.2.3)
devise-i18n (0.11.0)
diff-lcs (1.4.4)
- docile (1.1.5)
+ docile (1.3.2)
domain_name (0.5.25)
unf (>= 0.0.5, < 1.0.0)
dusen (0.6.1)
@@ -167,16 +167,23 @@ GEM
gherkin (5.1.0)
globalid (0.4.2)
activesupport (>= 4.2.0)
- haml (4.0.5)
+ haml (5.2.0)
+ temple (>= 0.8.0)
tilt
- haml-rails (0.5.3)
+ haml-rails (1.0.0)
actionpack (>= 4.0.1)
activesupport (>= 4.0.1)
- haml (>= 3.1, < 5.0)
+ haml (>= 4.0.6, < 6.0)
+ html2haml (>= 1.0.1)
railties (>= 4.0.1)
hashdiff (0.3.7)
hashie (4.1.0)
hike (1.2.3)
+ html2haml (2.2.0)
+ erubis (~> 2.7.0)
+ haml (>= 4.0, < 6)
+ nokogiri (>= 1.6.0)
+ ruby_parser (~> 3.5)
http-cookie (1.0.2)
domain_name (~> 0.5)
http_accept_language (2.0.2)
@@ -193,7 +200,7 @@ GEM
jquery-turbolinks (2.0.1)
railties (>= 3.1.0)
turbolinks
- json (1.8.6)
+ json (2.3.1)
jwt (2.2.2)
kaminari (1.2.1)
activesupport (>= 4.1.0)
@@ -290,8 +297,7 @@ GEM
rake (13.0.1)
rbnacl (4.0.2)
ffi
- rdoc (4.1.1)
- json (~> 1.4)
+ rdoc (6.2.1)
redis (3.3.0)
ref (2.0.0)
regexp_parser (1.8.2)
@@ -308,23 +314,25 @@ GEM
activemodel (>= 3.0)
activesupport (>= 3.0)
rspec-mocks (>= 2.99, < 4.0)
- rspec-core (3.5.4)
- rspec-support (~> 3.5.0)
- rspec-expectations (3.5.0)
+ rspec-core (3.10.0)
+ rspec-support (~> 3.10.0)
+ rspec-expectations (3.10.0)
diff-lcs (>= 1.2.0, < 2.0)
- rspec-support (~> 3.5.0)
- rspec-mocks (3.5.0)
+ rspec-support (~> 3.10.0)
+ rspec-mocks (3.10.0)
diff-lcs (>= 1.2.0, < 2.0)
- rspec-support (~> 3.5.0)
- rspec-rails (3.5.2)
- actionpack (>= 3.0)
- activesupport (>= 3.0)
- railties (>= 3.0)
- rspec-core (~> 3.5.0)
- rspec-expectations (~> 3.5.0)
- rspec-mocks (~> 3.5.0)
- rspec-support (~> 3.5.0)
- rspec-support (3.5.0)
+ rspec-support (~> 3.10.0)
+ rspec-rails (4.0.1)
+ actionpack (>= 4.2)
+ activesupport (>= 4.2)
+ railties (>= 4.2)
+ rspec-core (~> 3.9)
+ rspec-expectations (~> 3.9)
+ rspec-mocks (~> 3.9)
+ rspec-support (~> 3.9)
+ rspec-support (3.10.0)
+ ruby_parser (3.15.0)
+ sexp_processor (~> 4.9)
safe_yaml (1.0.4)
sass (3.2.13)
sass-rails (4.0.1)
@@ -334,20 +342,19 @@ GEM
sawyer (0.8.1)
addressable (>= 2.3.5, < 2.6)
faraday (~> 0.8, < 1.0)
- sdoc (0.4.0)
- json (~> 1.8)
- rdoc (~> 4.0, < 5.0)
+ sdoc (2.0.2)
+ rdoc (>= 5.0)
+ sexp_processor (4.15.1)
shoulda-matchers (3.1.1)
activesupport (>= 4.0.0)
sidekiq (4.0.2)
concurrent-ruby (~> 1.0)
connection_pool (~> 2.2, >= 2.2.0)
redis (~> 3.2, >= 3.2.1)
- simplecov (0.15.1)
- docile (~> 1.1.0)
- json (>= 1.8, < 3)
- simplecov-html (~> 0.10.0)
- simplecov-html (0.10.2)
+ simplecov (0.19.1)
+ docile (~> 1.1)
+ simplecov-html (~> 0.11)
+ simplecov-html (0.12.3)
sprockets (2.12.5)
hike (~> 1.2)
multi_json (~> 1.0)
@@ -361,6 +368,7 @@ GEM
sshkit (1.12.0)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
+ temple (0.8.2)
therubyracer (0.12.3)
libv8 (~> 3.16.14.15)
ref
@@ -410,7 +418,7 @@ DEPENDENCIES
dusen (~> 0.6.1)
easy_gravatar
factory_girl_rails (~> 4.3.0)
- haml-rails (~> 0.5.3)
+ haml-rails (~> 1.0)
http_accept_language
i18n-js
jbuilder (~> 1.5.3)
@@ -430,7 +438,7 @@ DEPENDENCIES
render_csv
rest-client
rspec-activemodel-mocks
- rspec-rails (~> 3.5.0)
+ rspec-rails (~> 4.0)
sass-rails (~> 4.0.0)
sawyer (~> 0.8.0)
sdoc
From 141c82d67890a48ee424336a326c94d0600a2b01 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Fri, 20 Nov 2020 09:41:13 +0100
Subject: [PATCH 055/159] Allow users to set betch32 addresses
Closes #363
---
Gemfile | 1 +
Gemfile.lock | 2 +
config/config.yml.sample | 5 +-
features/bitcoin_address.feature | 72 +++
...d_be_able_to_set_Bech32_P2WPKH_address.yml | 419 ++++++++++++++++++
...ld_be_able_to_set_Bech32_P2WSH_address.yml | 419 ++++++++++++++++++
...rs_should_be_able_to_set_P2PKH_address.yml | 419 ++++++++++++++++++
...ers_should_be_able_to_set_P2SH_address.yml | 419 ++++++++++++++++++
...t_be_able_to_set_invalid_P2PKH_address.yml | 419 ++++++++++++++++++
...ot_be_able_to_set_invalid_P2SH_address.yml | 419 ++++++++++++++++++
..._be_able_to_set_testnet_Bech32_address.yml | 419 ++++++++++++++++++
...uld_not_be_able_to_set_testnet_address.yml | 419 ++++++++++++++++++
lib/bitcoin_address_validator.rb | 33 +-
spec/models/user_spec.rb | 38 +-
14 files changed, 3496 insertions(+), 7 deletions(-)
create mode 100644 features/bitcoin_address.feature
create mode 100644 features/cassettes/Users_should_be_able_to_change_their_bitcoin_address/Users_should_be_able_to_set_Bech32_P2WPKH_address.yml
create mode 100644 features/cassettes/Users_should_be_able_to_change_their_bitcoin_address/Users_should_be_able_to_set_Bech32_P2WSH_address.yml
create mode 100644 features/cassettes/Users_should_be_able_to_change_their_bitcoin_address/Users_should_be_able_to_set_P2PKH_address.yml
create mode 100644 features/cassettes/Users_should_be_able_to_change_their_bitcoin_address/Users_should_be_able_to_set_P2SH_address.yml
create mode 100644 features/cassettes/Users_should_be_able_to_change_their_bitcoin_address/Users_should_not_be_able_to_set_invalid_P2PKH_address.yml
create mode 100644 features/cassettes/Users_should_be_able_to_change_their_bitcoin_address/Users_should_not_be_able_to_set_invalid_P2SH_address.yml
create mode 100644 features/cassettes/Users_should_be_able_to_change_their_bitcoin_address/Users_should_not_be_able_to_set_testnet_Bech32_address.yml
create mode 100644 features/cassettes/Users_should_be_able_to_change_their_bitcoin_address/Users_should_not_be_able_to_set_testnet_address.yml
diff --git a/Gemfile b/Gemfile
index 5b0aed9c..434656b9 100644
--- a/Gemfile
+++ b/Gemfile
@@ -7,6 +7,7 @@ gem 'rails', '4.2.11.3'
gem 'acts_as_paranoid', github: 'ActsAsParanoid/acts_as_paranoid'
gem 'airbrake', '~> 3.1.15'
gem 'bcrypt', '~> 3.1.12'
+gem 'bech32', '~> 1.0.5'
gem 'bootstrap_form', github: 'bootstrap-ruby/rails-bootstrap-forms'
gem 'cancancan'
gem 'coffee-rails', '~> 4.0.0'
diff --git a/Gemfile.lock b/Gemfile.lock
index 30498c23..5ff6de4c 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -77,6 +77,7 @@ GEM
backports (3.18.2)
bcrypt (3.1.16)
bcrypt_pbkdf (1.0.0)
+ bech32 (1.0.5)
builder (3.2.4)
cancancan (1.7.1)
capistrano (3.4.1)
@@ -403,6 +404,7 @@ DEPENDENCIES
airbrake (~> 3.1.15)
bcrypt (~> 3.1.12)
bcrypt_pbkdf (~> 1.0.0)
+ bech32 (~> 1.0.5)
bootstrap_form!
cancancan
capistrano (~> 3.4.0)
diff --git a/config/config.yml.sample b/config/config.yml.sample
index da55e009..9f70e7fc 100644
--- a/config/config.yml.sample
+++ b/config/config.yml.sample
@@ -40,6 +40,5 @@ min_tip: 50000 # optional
deposit_address: 1M4bS4gPyA6Kb8w7aXsgth9oUZWcRk73tQ
-address_versions: # 0/5 for bitcoin addresses, 111/196 for testnet, see chainparams.cpp
- - 0
- - 5
+# Can be testnet or mainnet
+network: mainnet
diff --git a/features/bitcoin_address.feature b/features/bitcoin_address.feature
new file mode 100644
index 00000000..5a8d47c7
--- /dev/null
+++ b/features/bitcoin_address.feature
@@ -0,0 +1,72 @@
+Feature: Users should be able to change their bitcoin address
+ Background:
+ Given a developer named "seldon" exists without a bitcoin address
+ And I'm signed in as "seldon"
+
+ @vcr-ignore-params
+ Scenario: Users should be able to set P2PKH address
+ Given I visit the "seldon user" page
+ Then I should see "Bitcoin address"
+ When I fill "Bitcoin address" with: "1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2"
+ And I click "Update user info"
+ Then I should see "Your information saved!"
+
+ @vcr-ignore-params
+ Scenario: Users should not be able to set invalid P2PKH address
+ Given I visit the "seldon user" page
+ Then I should see "Bitcoin address"
+ When I fill "Bitcoin address" with: "1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVA"
+ And I click "Update user info"
+ Then I should not see "Your information saved!"
+ And I should see "Bitcoin address is invalid"
+
+ @vcr-ignore-params
+ Scenario: Users should be able to set P2SH address
+ Given I visit the "seldon user" page
+ Then I should see "Bitcoin address"
+ When I fill "Bitcoin address" with: "3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy"
+ And I click "Update user info"
+ Then I should see "Your information saved!"
+
+ @vcr-ignore-params
+ Scenario: Users should not be able to set invalid P2SH address
+ Given I visit the "seldon user" page
+ Then I should see "Bitcoin address"
+ When I fill "Bitcoin address" with: "3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLA"
+ And I click "Update user info"
+ Then I should not see "Your information saved!"
+ And I should see "Bitcoin address is invalid"
+
+ @vcr-ignore-params
+ Scenario: Users should not be able to set testnet address
+ Given I visit the "seldon user" page
+ Then I should see "Bitcoin address"
+ When I fill "Bitcoin address" with: "mtXWDB6k5yC5v7TcwKZHB89SUp85yCKshy"
+ And I click "Update user info"
+ Then I should not see "Your information saved!"
+ And I should see "Bitcoin address is invalid"
+
+ @vcr-ignore-params
+ Scenario: Users should be able to set Bech32 P2WPKH address
+ Given I visit the "seldon user" page
+ Then I should see "Bitcoin address"
+ When I fill "Bitcoin address" with: "bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4"
+ And I click "Update user info"
+ Then I should see "Your information saved!"
+
+ @vcr-ignore-params
+ Scenario: Users should be able to set Bech32 P2WSH address
+ Given I visit the "seldon user" page
+ Then I should see "Bitcoin address"
+ When I fill "Bitcoin address" with: "bc1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qccfmv3"
+ And I click "Update user info"
+ Then I should see "Your information saved!"
+
+ @vcr-ignore-params
+ Scenario: Users should not be able to set testnet Bech32 address
+ Given I visit the "seldon user" page
+ Then I should see "Bitcoin address"
+ When I fill "Bitcoin address" with: "tb1qw508d6qejxtdg4y5r3zarvary0c5xw7kxpjzsx"
+ And I click "Update user info"
+ Then I should not see "Your information saved!"
+ And I should see "Bitcoin address is invalid"
\ No newline at end of file
diff --git a/features/cassettes/Users_should_be_able_to_change_their_bitcoin_address/Users_should_be_able_to_set_Bech32_P2WPKH_address.yml b/features/cassettes/Users_should_be_able_to_change_their_bitcoin_address/Users_should_be_able_to_set_Bech32_P2WPKH_address.yml
new file mode 100644
index 00000000..d80f96af
--- /dev/null
+++ b/features/cassettes/Users_should_be_able_to_change_their_bitcoin_address/Users_should_be_able_to_set_Bech32_P2WPKH_address.yml
@@ -0,0 +1,419 @@
+---
+http_interactions:
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:05:51 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:05:51 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:05:51 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:05:51 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:05:51 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:05:51 GMT
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:05:52 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:05:51 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:05:52 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:05:53 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:05:53 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:05:53 GMT
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:05:54 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:05:54 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:05:54 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:05:55 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:05:55 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:05:56 GMT
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:05:57 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:05:57 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:05:57 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:06:01 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:06:01 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:06:01 GMT
+recorded_with: VCR 3.0.3
diff --git a/features/cassettes/Users_should_be_able_to_change_their_bitcoin_address/Users_should_be_able_to_set_Bech32_P2WSH_address.yml b/features/cassettes/Users_should_be_able_to_change_their_bitcoin_address/Users_should_be_able_to_set_Bech32_P2WSH_address.yml
new file mode 100644
index 00000000..5bc39b8c
--- /dev/null
+++ b/features/cassettes/Users_should_be_able_to_change_their_bitcoin_address/Users_should_be_able_to_set_Bech32_P2WSH_address.yml
@@ -0,0 +1,419 @@
+---
+http_interactions:
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:06:02 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:06:02 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:06:02 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:06:02 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:06:02 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:06:02 GMT
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:06:03 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:06:03 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:06:03 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:06:03 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:06:03 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:06:03 GMT
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:06:03 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:06:03 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:06:03 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:06:04 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:06:04 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:06:04 GMT
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:06:04 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:06:04 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:06:04 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:06:05 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:06:05 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:06:05 GMT
+recorded_with: VCR 3.0.3
diff --git a/features/cassettes/Users_should_be_able_to_change_their_bitcoin_address/Users_should_be_able_to_set_P2PKH_address.yml b/features/cassettes/Users_should_be_able_to_change_their_bitcoin_address/Users_should_be_able_to_set_P2PKH_address.yml
new file mode 100644
index 00000000..3f40730d
--- /dev/null
+++ b/features/cassettes/Users_should_be_able_to_change_their_bitcoin_address/Users_should_be_able_to_set_P2PKH_address.yml
@@ -0,0 +1,419 @@
+---
+http_interactions:
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 07:55:55 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 07:55:55 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 07:55:55 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 07:55:56 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 07:55:56 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 07:55:56 GMT
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 07:55:57 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 07:55:57 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 07:55:57 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 07:55:58 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 07:55:58 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 07:55:59 GMT
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 07:56:00 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 07:56:00 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 07:56:00 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 07:56:01 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 07:56:01 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 07:56:01 GMT
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 07:56:03 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 07:56:03 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 07:56:03 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 07:56:04 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 07:56:04 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 07:56:05 GMT
+recorded_with: VCR 3.0.3
diff --git a/features/cassettes/Users_should_be_able_to_change_their_bitcoin_address/Users_should_be_able_to_set_P2SH_address.yml b/features/cassettes/Users_should_be_able_to_change_their_bitcoin_address/Users_should_be_able_to_set_P2SH_address.yml
new file mode 100644
index 00000000..cb27e4cd
--- /dev/null
+++ b/features/cassettes/Users_should_be_able_to_change_their_bitcoin_address/Users_should_be_able_to_set_P2SH_address.yml
@@ -0,0 +1,419 @@
+---
+http_interactions:
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:00:55 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:00:55 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:00:55 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:00:56 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:00:56 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:00:57 GMT
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:00:57 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:00:57 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:00:57 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:00:58 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:00:58 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:00:59 GMT
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:00:59 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:00:59 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:00:59 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:00:59 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:00:59 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:00:59 GMT
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:01:00 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:01:00 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:01:00 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:01:00 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:01:00 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:01:00 GMT
+recorded_with: VCR 3.0.3
diff --git a/features/cassettes/Users_should_be_able_to_change_their_bitcoin_address/Users_should_not_be_able_to_set_invalid_P2PKH_address.yml b/features/cassettes/Users_should_be_able_to_change_their_bitcoin_address/Users_should_not_be_able_to_set_invalid_P2PKH_address.yml
new file mode 100644
index 00000000..f64e7593
--- /dev/null
+++ b/features/cassettes/Users_should_be_able_to_change_their_bitcoin_address/Users_should_not_be_able_to_set_invalid_P2PKH_address.yml
@@ -0,0 +1,419 @@
+---
+http_interactions:
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 07:58:21 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 07:58:21 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 07:58:22 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 07:58:23 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 07:58:23 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 07:58:23 GMT
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 07:58:24 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 07:58:24 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 07:58:24 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 07:58:25 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 07:58:25 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 07:58:26 GMT
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 07:58:27 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 07:58:27 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 07:58:27 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 07:58:29 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 07:58:29 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 07:58:29 GMT
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 07:58:30 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 07:58:30 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 07:58:30 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 07:58:31 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 07:58:31 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 07:58:32 GMT
+recorded_with: VCR 3.0.3
diff --git a/features/cassettes/Users_should_be_able_to_change_their_bitcoin_address/Users_should_not_be_able_to_set_invalid_P2SH_address.yml b/features/cassettes/Users_should_be_able_to_change_their_bitcoin_address/Users_should_not_be_able_to_set_invalid_P2SH_address.yml
new file mode 100644
index 00000000..e7c955b9
--- /dev/null
+++ b/features/cassettes/Users_should_be_able_to_change_their_bitcoin_address/Users_should_not_be_able_to_set_invalid_P2SH_address.yml
@@ -0,0 +1,419 @@
+---
+http_interactions:
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:01:01 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:01:01 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:01:01 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:01:01 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:01:01 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:01:02 GMT
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:01:02 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:01:02 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:01:02 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:01:02 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:01:02 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:01:02 GMT
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:01:03 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:01:03 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:01:03 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:01:03 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:01:03 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:01:03 GMT
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:01:03 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:01:03 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:01:04 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:01:04 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:01:04 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:01:04 GMT
+recorded_with: VCR 3.0.3
diff --git a/features/cassettes/Users_should_be_able_to_change_their_bitcoin_address/Users_should_not_be_able_to_set_testnet_Bech32_address.yml b/features/cassettes/Users_should_be_able_to_change_their_bitcoin_address/Users_should_not_be_able_to_set_testnet_Bech32_address.yml
new file mode 100644
index 00000000..4c44eba2
--- /dev/null
+++ b/features/cassettes/Users_should_be_able_to_change_their_bitcoin_address/Users_should_not_be_able_to_set_testnet_Bech32_address.yml
@@ -0,0 +1,419 @@
+---
+http_interactions:
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:06:05 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:06:05 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:06:05 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:06:06 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:06:06 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:06:06 GMT
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:06:06 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:06:06 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:06:06 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:06:07 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:06:07 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:06:07 GMT
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:06:07 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:06:07 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:06:07 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:06:08 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:06:08 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:06:08 GMT
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:06:08 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:06:08 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:06:08 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:06:08 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:06:08 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:06:08 GMT
+recorded_with: VCR 3.0.3
diff --git a/features/cassettes/Users_should_be_able_to_change_their_bitcoin_address/Users_should_not_be_able_to_set_testnet_address.yml b/features/cassettes/Users_should_be_able_to_change_their_bitcoin_address/Users_should_not_be_able_to_set_testnet_address.yml
new file mode 100644
index 00000000..3a4ef0be
--- /dev/null
+++ b/features/cassettes/Users_should_be_able_to_change_their_bitcoin_address/Users_should_not_be_able_to_set_testnet_address.yml
@@ -0,0 +1,419 @@
+---
+http_interactions:
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:05:36 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:05:36 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:05:37 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:05:38 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:05:38 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:05:38 GMT
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:05:39 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:05:39 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:05:39 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:05:40 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:05:40 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:05:40 GMT
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:05:41 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:05:41 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:05:42 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:05:47 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:05:47 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:05:47 GMT
+- request:
+ method: get
+ uri: https://www.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - www.gravatar.com
+ response:
+ status:
+ code: 302
+ message: Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:05:48 GMT
+ Content-Type:
+ - text/html; charset=utf-8
+ Content-Length:
+ - '0'
+ Connection:
+ - keep-alive
+ P3p:
+ - CP="CAO PSA"
+ X-Frame-Options:
+ - SAMEORIGIN
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:05:48 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ Location:
+ - https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: UTF-8
+ string: ''
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:05:48 GMT
+- request:
+ method: get
+ uri: https://en.gravatar.com/2a143fe61195731f2191768efee317a8.json
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ Host:
+ - en.gravatar.com
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 20 Nov 2020 08:05:49 GMT
+ Content-Type:
+ - application/json
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ P3p:
+ - CP="CAO PSA"
+ Expires:
+ - Wed, 11 Jan 1984 05:00:00 GMT
+ Last-Modified:
+ - Fri, 20 Nov 2020 08:05:49 GMT
+ Cache-Control:
+ - no-cache, must-revalidate, max-age=0
+ Pragma:
+ - no-cache
+ X-Frame-Options:
+ - SAMEORIGIN
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - "*"
+ Access-Control-Allow-Methods:
+ - GET, OPTIONS
+ body:
+ encoding: ASCII-8BIT
+ string: '"User not found"'
+ http_version:
+ recorded_at: Fri, 20 Nov 2020 08:05:50 GMT
+recorded_with: VCR 3.0.3
diff --git a/lib/bitcoin_address_validator.rb b/lib/bitcoin_address_validator.rb
index 46d75f5f..65caccb2 100644
--- a/lib/bitcoin_address_validator.rb
+++ b/lib/bitcoin_address_validator.rb
@@ -9,12 +9,41 @@ def validate_each(record, field, value)
private
+ BECH32_HRP = {
+ mainnet: 'bc',
+ testnet: 'tb'
+ }.freeze
+
+ def valid_bitcoin_address?(addr)
+ valid_segwit_address?(addr) || valid_legacy_address?(addr)
+ end
+
+ def valid_segwit_address?(addr)
+ segwit_addr = parse_segwit_address(addr)
+ return true if segwit_addr && segwit_addr.hrp == BECH32_HRP[CONFIG['network'].to_sym]
+
+ false
+ end
+
+ def parse_segwit_address(addr)
+ Bech32::SegwitAddr.new(addr)
+ rescue RuntimeError => e
+ return nil if e.message == 'Invalid address.'
+
+ raise
+ end
+
B58Chars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
B58Base = B58Chars.length
- def valid_bitcoin_address?(address)
+ EXPECTED_VERSIONS = {
+ mainnet: [0, 5],
+ testnet: [111, 196]
+ }.freeze
+
+ def valid_legacy_address?(address)
if (address =~ /^[a-zA-Z1-9]{33,35}$/) and version = version(address)
- if (expected_versions = CONFIG["address_versions"]).present?
+ if (expected_versions = EXPECTED_VERSIONS[CONFIG['network'].to_sym]).present?
expected_versions.include?(version.ord)
else
true
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index b8fd6051..1381b14e 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -37,19 +37,53 @@
end
end
- context 'when address is valid' do
+ context 'when address is valid p2pkh address' do
it 'should be valid' do
user.bitcoin_address = '1M4bS4gPyA6Kb8w7aXsgth9oUZWcRk73tQ'
expect(user).to be_valid
end
end
- context 'when address is not valid' do
+ context 'when address is valid p2sh address' do
+ it 'should be valid' do
+ user.bitcoin_address = '3EktnHQD7RiAE6uzMj2ZifT9YgRrkSgzQX'
+ expect(user).to be_valid
+ end
+ end
+
+ context 'when address is valid bech32 P2WPKH address' do
+ it 'should be valid' do
+ user.bitcoin_address = 'BC1QW508D6QEJXTDG4Y5R3ZARVARY0C5XW7KV8F3T4'
+ expect(user).to be_valid
+ end
+ end
+
+ context 'when address is valid bech32 P2WSH address' do
+ it 'should be valid' do
+ user.bitcoin_address = 'bc1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qccfmv3'
+ expect(user).to be_valid
+ end
+ end
+
+ context 'when address is not valid p2pkh' do
it 'should not be valid' do
user.bitcoin_address = '1M4bS4gPyA6Kb8w7aXsgth9oUZXXXXXXXX'
expect(user).not_to be_valid
end
end
+ context 'when address is testnet bech32' do
+ it 'should not be valid' do
+ user.bitcoin_address = 'tb1qw508d6qejxtdg4y5r3zarvary0c5xw7kxpjzsx'
+ expect(user).not_to be_valid
+ end
+ end
+
+ context 'when address is not valid bech32' do
+ it 'should not be valid' do
+ user.bitcoin_address = 'tb1qw508d6qejxtdg4y5r3zarvary0c5xw7kxpjzsx'
+ expect(user).not_to be_valid
+ end
+ end
end
end
From b828cab0873860261334aa22332ec700c3bc24f4 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Fri, 20 Nov 2020 14:02:20 +0100
Subject: [PATCH 056/159] Migrated from abandoned twitter-bootstrap-form to
bootstrap-form
---
Gemfile | 3 +--
Gemfile.lock | 18 ++----------------
app/views/devise/confirmations/new.html.haml | 2 +-
app/views/devise/passwords/edit.html.haml | 2 +-
app/views/devise/passwords/new.html.haml | 2 +-
app/views/devise/registrations/edit.html.haml | 2 +-
app/views/devise/registrations/new.html.haml | 2 +-
app/views/devise/sessions/new.html.haml | 4 ++--
app/views/users/show.html.haml | 10 +++++-----
9 files changed, 15 insertions(+), 30 deletions(-)
diff --git a/Gemfile b/Gemfile
index 434656b9..b2410525 100644
--- a/Gemfile
+++ b/Gemfile
@@ -8,7 +8,7 @@ gem 'acts_as_paranoid', github: 'ActsAsParanoid/acts_as_paranoid'
gem 'airbrake', '~> 3.1.15'
gem 'bcrypt', '~> 3.1.12'
gem 'bech32', '~> 1.0.5'
-gem 'bootstrap_form', github: 'bootstrap-ruby/rails-bootstrap-forms'
+gem 'bootstrap_form', '~> 2.7.0'
gem 'cancancan'
gem 'coffee-rails', '~> 4.0.0'
gem 'demoji'
@@ -41,7 +41,6 @@ gem 'sprockets', '~> 2.12.5'
gem 'therubyracer', '~> 0.12.2', platforms: :ruby
gem 'turbolinks', '~> 2.5.0'
gem 'twitter-bootstrap-rails', github: 'seyhunak/twitter-bootstrap-rails', branch: 'bootstrap3'
-gem 'twitter_bootstrap_form_for', github: 'stouset/twitter_bootstrap_form_for'
gem 'uglifier', '>= 1.3.0'
group :development do
diff --git a/Gemfile.lock b/Gemfile.lock
index 5ff6de4c..1f60b733 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -6,12 +6,6 @@ GIT
activerecord (~> 4.0)
activesupport (~> 4.0)
-GIT
- remote: git://github.com/bootstrap-ruby/rails-bootstrap-forms.git
- revision: bb5e1ca8b8fdb6405feb162338e45468dac83c30
- specs:
- bootstrap_form (2.2.0)
-
GIT
remote: git://github.com/seyhunak/twitter-bootstrap-rails.git
revision: 4d0bd4271f7f01d79bbb2b72c04f30a5766db0ef
@@ -23,14 +17,6 @@ GIT
rails (>= 3.1)
railties (>= 3.1)
-GIT
- remote: git://github.com/stouset/twitter_bootstrap_form_for.git
- revision: 830dbfd439ebb1194e1ae025100fc0e790be37cf
- specs:
- twitter_bootstrap_form_for (2.0.0.beta)
- actionpack (~> 4)
- railties (~> 4)
-
GEM
remote: https://rubygems.org/
specs:
@@ -78,6 +64,7 @@ GEM
bcrypt (3.1.16)
bcrypt_pbkdf (1.0.0)
bech32 (1.0.5)
+ bootstrap_form (2.7.0)
builder (3.2.4)
cancancan (1.7.1)
capistrano (3.4.1)
@@ -405,7 +392,7 @@ DEPENDENCIES
bcrypt (~> 3.1.12)
bcrypt_pbkdf (~> 1.0.0)
bech32 (~> 1.0.5)
- bootstrap_form!
+ bootstrap_form (~> 2.7.0)
cancancan
capistrano (~> 3.4.0)
capistrano-bundler (~> 1.1.2)
@@ -452,7 +439,6 @@ DEPENDENCIES
therubyracer (~> 0.12.2)
turbolinks (~> 2.5.0)
twitter-bootstrap-rails!
- twitter_bootstrap_form_for!
uglifier (>= 1.3.0)
vcr
webmock
diff --git a/app/views/devise/confirmations/new.html.haml b/app/views/devise/confirmations/new.html.haml
index 98616ee4..9dde55ad 100644
--- a/app/views/devise/confirmations/new.html.haml
+++ b/app/views/devise/confirmations/new.html.haml
@@ -1,4 +1,4 @@
-= twitter_bootstrap_form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post, class: 'form-devise' }) do |f|
+= bootstrap_form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post, class: 'form-devise' }) do |f|
%h2= t('.title')
= devise_error_messages!
= f.email_field :email, :autofocus => true
diff --git a/app/views/devise/passwords/edit.html.haml b/app/views/devise/passwords/edit.html.haml
index 64d97232..bdf65f15 100644
--- a/app/views/devise/passwords/edit.html.haml
+++ b/app/views/devise/passwords/edit.html.haml
@@ -1,4 +1,4 @@
-= twitter_bootstrap_form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put, class: 'form-devise' }) do |f|
+= bootstrap_form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put, class: 'form-devise' }) do |f|
%h2= t('.title')
= devise_error_messages!
= f.hidden_field :reset_password_token
diff --git a/app/views/devise/passwords/new.html.haml b/app/views/devise/passwords/new.html.haml
index 0099a39b..2785390c 100644
--- a/app/views/devise/passwords/new.html.haml
+++ b/app/views/devise/passwords/new.html.haml
@@ -1,4 +1,4 @@
-= twitter_bootstrap_form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post, class: 'form-devise', role: 'form' }) do |f|
+= bootstrap_form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post, class: 'form-devise', role: 'form' }) do |f|
%h2= t('.title')
= devise_error_messages!
= f.email_field :email, :autofocus => true
diff --git a/app/views/devise/registrations/edit.html.haml b/app/views/devise/registrations/edit.html.haml
index 84a01fc1..a39e9c5b 100644
--- a/app/views/devise/registrations/edit.html.haml
+++ b/app/views/devise/registrations/edit.html.haml
@@ -1,4 +1,4 @@
-= twitter_bootstrap_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put, class: 'form-devise' }) do |f|
+= bootstrap_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put, class: 'form-devise' }) do |f|
%h2
Edit #{resource_name.to_s.humanize}
= render "devise/shared/error_messages", resource: resource
diff --git a/app/views/devise/registrations/new.html.haml b/app/views/devise/registrations/new.html.haml
index 721caa85..09c797b0 100644
--- a/app/views/devise/registrations/new.html.haml
+++ b/app/views/devise/registrations/new.html.haml
@@ -1,4 +1,4 @@
-= twitter_bootstrap_form_for(resource, :as => resource_name, :url => registration_path(resource_name), html: { class: 'form-devise registration_form'}) do |f|
+= bootstrap_form_for(resource, :as => resource_name, :url => registration_path(resource_name), html: { class: 'form-devise registration_form'}) do |f|
%h2= t('.title')
= render "devise/shared/error_messages", resource: resource
= f.email_field :email, :autofocus => true
diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml
index 2d75b67f..45f1cff3 100644
--- a/app/views/devise/sessions/new.html.haml
+++ b/app/views/devise/sessions/new.html.haml
@@ -1,11 +1,11 @@
-= twitter_bootstrap_form_for(resource, :as => resource_name, :url => session_path(resource_name), html: {class: 'form-devise session_form' }) do |f|
+= bootstrap_form_for(resource, :as => resource_name, :url => session_path(resource_name), html: {class: 'form-devise session_form' }) do |f|
= render "devise/shared/error_messages", resource: resource
%h2= t('.title')
= f.email_field :email, :autofocus => true
= f.password_field :password, :autocomplete => "off"
- if devise_mapping.rememberable?
%div
- = f.check_box :remember_me, t('.remember_me')
+ = f.check_box :remember_me, label: t('.remember_me')
= f.submit t('.submit')
%p
= render "devise/shared/links"
diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml
index aaebe840..3f1e932f 100644
--- a/app/views/users/show.html.haml
+++ b/app/views/users/show.html.haml
@@ -23,7 +23,7 @@
%p
%strong= User.human_attribute_name(:email)
%p= @user.email
-= twitter_bootstrap_form_for @user do |f|
+= bootstrap_form_for @user do |f|
= f.text_field :bitcoin_address, placeholder: t('.bitcoin_address_placeholder')
- if @user.gravatar_bitcoin.present?
%span.from-gravatar{data:{for: 'user[bitcoin_address]', value: @user.gravatar_bitcoin }}
@@ -33,14 +33,14 @@
%span.from-gravatar{data:{for: 'user[display_name]', value: @user.gravatar_display_name }}
= "#{t('.use_from_gravatar')}: #{@user.gravatar_display_name}"
- if f.object.bitcoin_address.blank?
- = f.check_box :unsubscribed, t('.notify'), { checked: !f.object.unsubscribed? }, '0', '1'
+ = f.check_box :unsubscribed, { label: t('.notify'), checked: !f.object.unsubscribed? }, '0', '1'
%br
= f.submit t('.submit_user')
%br
%p
%strong= link_to t('.change_password'), '#new_password_form', data: {toggle: "collapse"}
-= twitter_bootstrap_form_for @user, html: {class: (params[:new_password] ? '' : 'collapse'), id: 'new_password_form'} do |f|
+= bootstrap_form_for @user, html: {class: (params[:new_password] ? '' : 'collapse'), id: 'new_password_form'} do |f|
= hidden_field_tag :new_password, value: true
= f.password_field :password, autofocus: true, autocomplete: "off"
= f.password_field :password_confirmation, autocomplete: "off"
@@ -50,7 +50,7 @@
%p
%strong= link_to t('.delete_account'), '#delete_user_form', data: {toggle: "collapse"}
-= twitter_bootstrap_form_for @user, html: {class: (params[:delete_user] ? '' : 'collapse'), id: 'delete_user_form', method: 'DELETE'} do |f|
+= bootstrap_form_for @user, html: {class: (params[:delete_user] ? '' : 'collapse'), id: 'delete_user_form', method: 'DELETE'} do |f|
%p= t('.delete_account_notice')
= f.text_field :email, value: '', autocomplete: "off"
- = f.submit t('.delete_account_confirm'), class: 'btn-danger'
\ No newline at end of file
+ = f.submit t('.delete_account_confirm'), class: 'btn btn-danger'
\ No newline at end of file
From 0ce499b18294be76200bff62406546be4670e336 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Fri, 20 Nov 2020 14:34:24 +0100
Subject: [PATCH 057/159] Use the latest version of twitter-bootstrap-rails
---
Gemfile | 2 +-
Gemfile.lock | 20 +++++++-------------
2 files changed, 8 insertions(+), 14 deletions(-)
diff --git a/Gemfile b/Gemfile
index b2410525..ba85e787 100644
--- a/Gemfile
+++ b/Gemfile
@@ -40,7 +40,7 @@ gem 'sidekiq'
gem 'sprockets', '~> 2.12.5'
gem 'therubyracer', '~> 0.12.2', platforms: :ruby
gem 'turbolinks', '~> 2.5.0'
-gem 'twitter-bootstrap-rails', github: 'seyhunak/twitter-bootstrap-rails', branch: 'bootstrap3'
+gem 'twitter-bootstrap-rails'
gem 'uglifier', '>= 1.3.0'
group :development do
diff --git a/Gemfile.lock b/Gemfile.lock
index 1f60b733..b5d1a63e 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -6,17 +6,6 @@ GIT
activerecord (~> 4.0)
activesupport (~> 4.0)
-GIT
- remote: git://github.com/seyhunak/twitter-bootstrap-rails.git
- revision: 4d0bd4271f7f01d79bbb2b72c04f30a5766db0ef
- branch: bootstrap3
- specs:
- twitter-bootstrap-rails (2.2.7)
- actionpack (>= 3.1)
- execjs
- rails (>= 3.1)
- railties (>= 3.1)
-
GEM
remote: https://rubygems.org/
specs:
@@ -143,7 +132,7 @@ GEM
edge_rider (0.3.2)
activerecord
erubis (2.7.0)
- execjs (2.6.0)
+ execjs (2.7.0)
factory_girl (4.3.0)
activesupport (>= 3.0.0)
factory_girl_rails (4.3.0)
@@ -365,6 +354,11 @@ GEM
tilt (1.4.1)
turbolinks (2.5.3)
coffee-rails
+ twitter-bootstrap-rails (3.2.0)
+ actionpack (~> 4.1)
+ execjs (~> 2.2)
+ rails (~> 4.1)
+ railties (~> 4.1)
tzinfo (1.2.8)
thread_safe (~> 0.1)
uglifier (2.4.0)
@@ -438,7 +432,7 @@ DEPENDENCIES
sqlite3 (~> 1.3.11)
therubyracer (~> 0.12.2)
turbolinks (~> 2.5.0)
- twitter-bootstrap-rails!
+ twitter-bootstrap-rails
uglifier (>= 1.3.0)
vcr
webmock
From 86fd993de5c851e61a3850e22d04aa33fa492165 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Fri, 20 Nov 2020 14:36:52 +0100
Subject: [PATCH 058/159] Use the latest version of acts_as_paranoid
---
Gemfile | 2 +-
Gemfile.lock | 13 ++++---------
2 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/Gemfile b/Gemfile
index ba85e787..a13d0e4e 100644
--- a/Gemfile
+++ b/Gemfile
@@ -4,7 +4,7 @@ ruby '2.5.8'
gem 'rails', '4.2.11.3'
-gem 'acts_as_paranoid', github: 'ActsAsParanoid/acts_as_paranoid'
+gem 'acts_as_paranoid'
gem 'airbrake', '~> 3.1.15'
gem 'bcrypt', '~> 3.1.12'
gem 'bech32', '~> 1.0.5'
diff --git a/Gemfile.lock b/Gemfile.lock
index b5d1a63e..8c4d098f 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,11 +1,3 @@
-GIT
- remote: git://github.com/ActsAsParanoid/acts_as_paranoid.git
- revision: ddcd1915179c73f74985af6bc8935321ca2fe08d
- specs:
- acts_as_paranoid (0.5.0.beta1)
- activerecord (~> 4.0)
- activesupport (~> 4.0)
-
GEM
remote: https://rubygems.org/
specs:
@@ -43,6 +35,9 @@ GEM
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
+ acts_as_paranoid (0.6.3)
+ activerecord (>= 4.2, < 7.0)
+ activesupport (>= 4.2, < 7.0)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
airbrake (3.1.15)
@@ -381,7 +376,7 @@ PLATFORMS
ruby
DEPENDENCIES
- acts_as_paranoid!
+ acts_as_paranoid
airbrake (~> 3.1.15)
bcrypt (~> 3.1.12)
bcrypt_pbkdf (~> 1.0.0)
From 1eafd3a7616365ab6edbd403bcbc77e02c055119 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Fri, 20 Nov 2020 14:57:46 +0100
Subject: [PATCH 059/159] Updated jquery-rails and kaminari
---
Gemfile | 6 +++---
Gemfile.lock | 13 +++++++------
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/Gemfile b/Gemfile
index a13d0e4e..edf16814 100644
--- a/Gemfile
+++ b/Gemfile
@@ -16,13 +16,13 @@ gem 'devise', '~> 4.7.3'
gem 'devise-i18n'
gem 'dusen', '~> 0.6.1'
gem 'easy_gravatar'
-gem 'haml-rails', '~> 1.0'
+gem 'haml-rails'
gem 'http_accept_language'
gem 'i18n-js'
gem 'jbuilder', '~> 1.5.3'
-gem 'jquery-rails', '~> 3.1'
+gem 'jquery-rails'
gem 'jquery-turbolinks'
-gem 'kaminari', '~> 1.2.1'
+gem 'kaminari'
gem 'kaminari-i18n'
gem 'less-rails', '~> 2.4.2'
gem 'money-tree', '~> 0.10.0'
diff --git a/Gemfile.lock b/Gemfile.lock
index 8c4d098f..46d1e9c9 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -166,8 +166,9 @@ GEM
jbuilder (1.5.3)
activesupport (>= 3.0.0)
multi_json (>= 1.2.0)
- jquery-rails (3.1.4)
- railties (>= 3.0, < 5.0)
+ jquery-rails (4.4.0)
+ rails-dom-testing (>= 1, < 3)
+ railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
jquery-turbolinks (2.0.1)
railties (>= 3.1.0)
@@ -186,7 +187,7 @@ GEM
activerecord
kaminari-core (= 1.2.1)
kaminari-core (1.2.1)
- kaminari-i18n (0.2.0)
+ kaminari-i18n (0.5.0)
kaminari
rails
less (2.4.0)
@@ -396,13 +397,13 @@ DEPENDENCIES
dusen (~> 0.6.1)
easy_gravatar
factory_girl_rails (~> 4.3.0)
- haml-rails (~> 1.0)
+ haml-rails
http_accept_language
i18n-js
jbuilder (~> 1.5.3)
- jquery-rails (~> 3.1)
+ jquery-rails
jquery-turbolinks
- kaminari (~> 1.2.1)
+ kaminari
kaminari-i18n
less-rails (~> 2.4.2)
money-tree (~> 0.10.0)
From f1b40fdb45d807a614a0aa96e0119cd80091a9f5 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Fri, 20 Nov 2020 14:58:37 +0100
Subject: [PATCH 060/159] Use bundler 2
---
Gemfile.lock | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Gemfile.lock b/Gemfile.lock
index 46d1e9c9..2ce7b2cd 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -437,4 +437,4 @@ RUBY VERSION
ruby 2.5.8p224
BUNDLED WITH
- 1.17.3
+ 2.1.4
From b9610f442da93c69a6d1df35fba82dc1053d2c82 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Fri, 20 Nov 2020 15:17:55 +0100
Subject: [PATCH 061/159] Fixed github glyph
---
app/views/projects/show.html.haml | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml
index a05e85da..ff1f2424 100644
--- a/app/views/projects/show.html.haml
+++ b/app/views/projects/show.html.haml
@@ -7,7 +7,10 @@
.alert.alert-danger= t('.disabled_notifications')
%h1#project_header
- = (@project.avatar_url.nil?)? (glyph :github) : (image_tag @project.avatar_url , class: 'project_avatar_img')
+ - if @project.avatar_url.nil?
+ %i.icon-github
+ - else
+ = image_tag(@project.avatar_url, class: 'project_avatar_img')
= link_to @project.full_name , @project.github_url, target: '_blank'
.pull-right
- if @project.collaborators.empty?
From 9ff44ba844bd7eaf3d845fef71cb27416dad53d0 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sat, 21 Nov 2020 08:39:10 +0100
Subject: [PATCH 062/159] Migrated to Rails 5.2
---
Gemfile | 52 +--
Gemfile.lock | 405 ++++++++++--------
app/assets/config/manifest.js | 5 +
app/assets/javascripts/application.js | 10 +
app/assets/javascripts/bootstrap.js.coffee | 4 +-
app/assets/stylesheets/application.css | 2 +
.../stylesheets/bootstrap_and_overrides.css | 7 +
.../bootstrap_and_overrides.css.less | 30 --
app/controllers/application_controller.rb | 2 +-
app/controllers/projects_controller.rb | 4 +-
app/controllers/tips_controller.rb | 4 +-
app/controllers/users_controller.rb | 2 +-
app/helpers/projects_helper.rb | 4 +
app/models/application_record.rb | 3 +
app/models/collaborator.rb | 2 +-
app/models/deposit.rb | 2 +-
app/models/project.rb | 2 +-
app/models/sendmany.rb | 2 +-
app/models/tip.rb | 2 +-
app/models/tipping_policies_text.rb | 2 +-
app/models/user.rb | 2 +-
app/models/wallet.rb | 2 +-
app/views/devise/confirmations/new.html.haml | 2 +-
app/views/devise/passwords/edit.html.haml | 2 +-
app/views/devise/passwords/new.html.haml | 2 +-
app/views/devise/registrations/edit.html.haml | 2 +-
app/views/devise/registrations/new.html.haml | 2 +-
app/views/devise/sessions/new.html.haml | 2 +-
.../projects/decide_tip_amounts.html.haml | 2 +-
app/views/projects/index.html.haml | 8 +-
app/views/users/show.html.haml | 4 +-
config/application.rb | 3 +-
config/environments/development.rb | 2 +
config/environments/test.rb | 2 +
config/locales/en.bootstrap.yml | 23 +
db/schema.rb | 78 ++--
features/step_definitions/users_steps.rb | 7 +-
features/support/factory_bot.rb | 1 +
features/support/factory_girl.rb | 1 -
spec/controllers/deposits_controller_spec.rb | 2 +-
spec/controllers/projects_controller_spec.rb | 38 +-
spec/controllers/tips_controller_spec.rb | 2 +-
spec/controllers/users_controller_spec.rb | 8 +-
.../withdrawals_controller_spec.rb | 2 +-
spec/factories/deposit.rb | 10 +-
spec/factories/project.rb | 12 +-
spec/factories/sendmany.rb | 10 +-
spec/factories/tip.rb | 10 +-
spec/factories/user.rb | 10 +-
spec/factories/wallets.rb | 10 +-
spec/spec_helper.rb | 2 +-
51 files changed, 438 insertions(+), 371 deletions(-)
create mode 100644 app/assets/config/manifest.js
create mode 100644 app/assets/javascripts/application.js
create mode 100644 app/assets/stylesheets/bootstrap_and_overrides.css
delete mode 100644 app/assets/stylesheets/bootstrap_and_overrides.css.less
create mode 100644 app/models/application_record.rb
create mode 100644 config/locales/en.bootstrap.yml
create mode 100644 features/support/factory_bot.rb
delete mode 100644 features/support/factory_girl.rb
diff --git a/Gemfile b/Gemfile
index edf16814..054cfe5c 100644
--- a/Gemfile
+++ b/Gemfile
@@ -2,46 +2,45 @@ source 'https://rubygems.org'
ruby '2.5.8'
-gem 'rails', '4.2.11.3'
+gem 'rails', '5.2.4.4'
gem 'acts_as_paranoid'
-gem 'airbrake', '~> 3.1.15'
-gem 'bcrypt', '~> 3.1.12'
-gem 'bech32', '~> 1.0.5'
-gem 'bootstrap_form', '~> 2.7.0'
+gem 'airbrake'
+gem 'bcrypt'
+gem 'bech32'
+gem 'bootstrap_form'
gem 'cancancan'
-gem 'coffee-rails', '~> 4.0.0'
+gem 'coffee-rails'
gem 'demoji'
-gem 'devise', '~> 4.7.3'
+gem 'devise'
gem 'devise-i18n'
-gem 'dusen', '~> 0.6.1'
+gem 'dusen'
gem 'easy_gravatar'
gem 'haml-rails'
gem 'http_accept_language'
gem 'i18n-js'
-gem 'jbuilder', '~> 1.5.3'
+gem 'jbuilder'
gem 'jquery-rails'
gem 'jquery-turbolinks'
gem 'kaminari'
gem 'kaminari-i18n'
-gem 'less-rails', '~> 2.4.2'
-gem 'money-tree', '~> 0.10.0'
-gem 'mysql2', '~> 0.4.10', group: :production
-gem 'octokit', '~> 4.7.0'
-gem 'omniauth', '~> 1.9.1'
+gem 'money-tree'
+gem 'mysql2', group: :production
+gem 'octokit'
+gem 'omniauth'
gem 'omniauth-github'
-gem 'rails-i18n', '~> 4.0.0'
+gem 'rails-i18n'
gem 'render_csv'
gem 'rest-client'
-gem 'sass-rails', '~> 4.0.0'
-gem 'sawyer', '~> 0.8.0'
+gem 'sass-rails'
+gem 'sawyer'
gem 'sdoc', group: :doc, require: false
gem 'sidekiq'
-gem 'sprockets', '~> 2.12.5'
-gem 'therubyracer', '~> 0.12.2', platforms: :ruby
-gem 'turbolinks', '~> 2.5.0'
+gem 'sprockets'
+gem 'therubyracer', platforms: :ruby
+gem 'turbolinks'
gem 'twitter-bootstrap-rails'
-gem 'uglifier', '>= 1.3.0'
+gem 'uglifier'
group :development do
gem 'capistrano', '~> 3.4.0'
@@ -55,17 +54,18 @@ group :development do
end
group :development, :test do
- gem 'factory_girl_rails', '~> 4.3.0'
- gem 'rspec-rails', '~> 4.0'
- gem 'sqlite3', '~> 1.3.11'
+ gem 'factory_bot_rails'
+ gem 'rspec-rails'
+ gem 'sqlite3'
end
group :test do
- gem 'cucumber-rails', '~> 1.0', require: false
+ gem 'cucumber-rails', '~> 1.0', require: false
gem 'database_cleaner'
gem 'rspec-activemodel-mocks'
- gem 'shoulda-matchers', '~> 3.1'
+ gem 'shoulda-matchers'
gem 'simplecov'
gem 'vcr'
gem 'webmock'
+ gem 'rails-controller-testing'
end
diff --git a/Gemfile.lock b/Gemfile.lock
index 2ce7b2cd..c72ff6a5 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,56 +1,66 @@
GEM
remote: https://rubygems.org/
specs:
- actionmailer (4.2.11.3)
- actionpack (= 4.2.11.3)
- actionview (= 4.2.11.3)
- activejob (= 4.2.11.3)
+ actioncable (5.2.4.4)
+ actionpack (= 5.2.4.4)
+ nio4r (~> 2.0)
+ websocket-driver (>= 0.6.1)
+ actionmailer (5.2.4.4)
+ actionpack (= 5.2.4.4)
+ actionview (= 5.2.4.4)
+ activejob (= 5.2.4.4)
mail (~> 2.5, >= 2.5.4)
- rails-dom-testing (~> 1.0, >= 1.0.5)
- actionpack (4.2.11.3)
- actionview (= 4.2.11.3)
- activesupport (= 4.2.11.3)
- rack (~> 1.6)
- rack-test (~> 0.6.2)
- rails-dom-testing (~> 1.0, >= 1.0.5)
+ rails-dom-testing (~> 2.0)
+ actionpack (5.2.4.4)
+ actionview (= 5.2.4.4)
+ activesupport (= 5.2.4.4)
+ rack (~> 2.0, >= 2.0.8)
+ rack-test (>= 0.6.3)
+ rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
- actionview (4.2.11.3)
- activesupport (= 4.2.11.3)
+ actionview (5.2.4.4)
+ activesupport (= 5.2.4.4)
builder (~> 3.1)
- erubis (~> 2.7.0)
- rails-dom-testing (~> 1.0, >= 1.0.5)
+ erubi (~> 1.4)
+ rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
- activejob (4.2.11.3)
- activesupport (= 4.2.11.3)
- globalid (>= 0.3.0)
- activemodel (4.2.11.3)
- activesupport (= 4.2.11.3)
- builder (~> 3.1)
- activerecord (4.2.11.3)
- activemodel (= 4.2.11.3)
- activesupport (= 4.2.11.3)
- arel (~> 6.0)
- activesupport (4.2.11.3)
- i18n (~> 0.7)
+ activejob (5.2.4.4)
+ activesupport (= 5.2.4.4)
+ globalid (>= 0.3.6)
+ activemodel (5.2.4.4)
+ activesupport (= 5.2.4.4)
+ activerecord (5.2.4.4)
+ activemodel (= 5.2.4.4)
+ activesupport (= 5.2.4.4)
+ arel (>= 9.0)
+ activestorage (5.2.4.4)
+ actionpack (= 5.2.4.4)
+ activerecord (= 5.2.4.4)
+ marcel (~> 0.3.1)
+ activesupport (5.2.4.4)
+ concurrent-ruby (~> 1.0, >= 1.0.2)
+ i18n (>= 0.7, < 2)
minitest (~> 5.1)
- thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
- acts_as_paranoid (0.6.3)
- activerecord (>= 4.2, < 7.0)
- activesupport (>= 4.2, < 7.0)
- addressable (2.5.2)
- public_suffix (>= 2.0.2, < 4.0)
- airbrake (3.1.15)
- builder
- multi_json
- arel (6.0.4)
+ acts_as_paranoid (0.7.0)
+ activerecord (>= 5.2, < 7.0)
+ activesupport (>= 5.2, < 7.0)
+ addressable (2.7.0)
+ public_suffix (>= 2.0.2, < 5.0)
+ airbrake (11.0.1)
+ airbrake-ruby (~> 5.1)
+ airbrake-ruby (5.1.1)
+ rbtree3 (~> 0.5)
+ arel (9.0.0)
backports (3.18.2)
bcrypt (3.1.16)
- bcrypt_pbkdf (1.0.0)
+ bcrypt_pbkdf (1.0.1)
bech32 (1.0.5)
- bootstrap_form (2.7.0)
+ bootstrap_form (4.5.0)
+ actionpack (>= 5.2)
+ activemodel (>= 5.2)
builder (3.2.4)
- cancancan (1.7.1)
+ cancancan (3.1.0)
capistrano (3.4.1)
i18n
rake (>= 10.0.0)
@@ -72,18 +82,17 @@ GEM
rack-test (>= 0.6.3)
regexp_parser (~> 1.5)
xpath (~> 3.2)
- coffee-rails (4.0.1)
+ coffee-rails (5.0.0)
coffee-script (>= 2.2.0)
- railties (>= 4.0.0, < 5.0)
+ railties (>= 5.2.0)
coffee-script (2.4.1)
coffee-script-source
execjs
- coffee-script-source (1.9.1.1)
+ coffee-script-source (1.12.2)
commonjs (0.2.7)
concurrent-ruby (1.1.7)
- connection_pool (2.2.0)
- crack (0.4.3)
- safe_yaml (~> 1.0.0)
+ connection_pool (2.2.3)
+ crack (0.4.4)
crass (1.0.6)
cucumber (3.2.0)
builder (>= 2.1.2)
@@ -108,33 +117,36 @@ GEM
cucumber-tag_expressions (1.1.1)
cucumber-wire (0.0.1)
database_cleaner (1.8.5)
- demoji (0.0.5)
+ demoji (0.0.7)
devise (4.7.3)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0)
responders
warden (~> 1.2.3)
- devise-i18n (0.11.0)
+ devise-i18n (1.9.2)
+ devise (>= 4.7.1)
diff-lcs (1.4.4)
docile (1.3.2)
- domain_name (0.5.25)
+ domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
dusen (0.6.1)
activerecord (>= 3.0)
edge_rider (>= 0.2.5)
easy_gravatar (1.0.1)
- edge_rider (0.3.2)
- activerecord
+ edge_rider (1.1.0)
+ activerecord (>= 3.2)
+ erubi (1.10.0)
erubis (2.7.0)
execjs (2.7.0)
- factory_girl (4.3.0)
- activesupport (>= 3.0.0)
- factory_girl_rails (4.3.0)
- factory_girl (~> 4.3.0)
- railties (>= 3.0.0)
- faraday (0.17.3)
+ factory_bot (6.1.0)
+ activesupport (>= 5.0.0)
+ factory_bot_rails (6.1.0)
+ factory_bot (~> 6.1.0)
+ railties (>= 5.0.0)
+ faraday (1.1.0)
multipart-post (>= 1.2, < 3)
+ ruby2_keywords
ffi (1.13.1)
gherkin (5.1.0)
globalid (0.4.2)
@@ -142,38 +154,36 @@ GEM
haml (5.2.0)
temple (>= 0.8.0)
tilt
- haml-rails (1.0.0)
- actionpack (>= 4.0.1)
- activesupport (>= 4.0.1)
+ haml-rails (2.0.1)
+ actionpack (>= 5.1)
+ activesupport (>= 5.1)
haml (>= 4.0.6, < 6.0)
html2haml (>= 1.0.1)
- railties (>= 4.0.1)
- hashdiff (0.3.7)
+ railties (>= 5.1)
+ hashdiff (1.0.1)
hashie (4.1.0)
- hike (1.2.3)
html2haml (2.2.0)
erubis (~> 2.7.0)
haml (>= 4.0, < 6)
nokogiri (>= 1.6.0)
ruby_parser (~> 3.5)
- http-cookie (1.0.2)
+ http-accept (1.7.0)
+ http-cookie (1.0.3)
domain_name (~> 0.5)
- http_accept_language (2.0.2)
- i18n (0.9.5)
+ http_accept_language (2.1.1)
+ i18n (1.8.5)
concurrent-ruby (~> 1.0)
- i18n-js (2.1.2)
- i18n
- jbuilder (1.5.3)
- activesupport (>= 3.0.0)
- multi_json (>= 1.2.0)
+ i18n-js (3.8.0)
+ i18n (>= 0.6.6)
+ jbuilder (2.10.1)
+ activesupport (>= 5.0.0)
jquery-rails (4.4.0)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
- jquery-turbolinks (2.0.1)
+ jquery-turbolinks (2.1.0)
railties (>= 3.1.0)
turbolinks
- json (2.3.1)
jwt (2.2.2)
kaminari (1.2.1)
activesupport (>= 4.1.0)
@@ -190,18 +200,25 @@ GEM
kaminari-i18n (0.5.0)
kaminari
rails
- less (2.4.0)
+ less (2.6.0)
commonjs (~> 0.2.7)
- less-rails (2.4.2)
- actionpack (>= 3.1)
- less (~> 2.4.0)
+ less-rails (4.0.0)
+ actionpack (>= 4)
+ less (~> 2.6.0)
+ sprockets (>= 2)
libv8 (3.16.14.19)
loofah (2.7.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
- mime-types (2.99.3)
+ marcel (0.3.3)
+ mimemagic (~> 0.3.2)
+ method_source (1.0.0)
+ mime-types (3.3.1)
+ mime-types-data (~> 3.2015)
+ mime-types-data (3.2020.1104)
+ mimemagic (0.3.5)
mini_mime (1.0.2)
mini_portile2 (2.4.0)
minitest (5.14.2)
@@ -211,11 +228,12 @@ GEM
multi_test (0.1.2)
multi_xml (0.6.0)
multipart-post (2.1.1)
- mysql2 (0.4.10)
- net-scp (1.2.1)
- net-ssh (>= 2.6.5)
- net-ssh (4.1.0)
+ mysql2 (0.5.3)
+ net-scp (3.0.0)
+ net-ssh (>= 2.6.5, < 7.0.0)
+ net-ssh (6.1.0)
netrc (0.11.0)
+ nio4r (2.5.4)
nokogiri (1.10.10)
mini_portile2 (~> 2.4.0)
oauth2 (1.4.4)
@@ -224,7 +242,8 @@ GEM
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
- octokit (4.7.0)
+ octokit (4.19.0)
+ faraday (>= 0.9)
sawyer (~> 0.8.0, >= 0.5.3)
omniauth (1.9.1)
hashie (>= 3.4.6)
@@ -236,54 +255,60 @@ GEM
oauth2 (~> 1.4)
omniauth (~> 1.9)
orm_adapter (0.5.0)
- public_suffix (3.0.1)
- rack (1.6.13)
- rack-test (0.6.3)
- rack (>= 1.0)
- rails (4.2.11.3)
- actionmailer (= 4.2.11.3)
- actionpack (= 4.2.11.3)
- actionview (= 4.2.11.3)
- activejob (= 4.2.11.3)
- activemodel (= 4.2.11.3)
- activerecord (= 4.2.11.3)
- activesupport (= 4.2.11.3)
- bundler (>= 1.3.0, < 2.0)
- railties (= 4.2.11.3)
- sprockets-rails
- rails-deprecated_sanitizer (1.0.3)
- activesupport (>= 4.2.0.alpha)
- rails-dom-testing (1.0.9)
- activesupport (>= 4.2.0, < 5.0)
- nokogiri (~> 1.6)
- rails-deprecated_sanitizer (>= 1.0.1)
+ public_suffix (4.0.6)
+ rack (2.2.3)
+ rack-test (1.1.0)
+ rack (>= 1.0, < 3)
+ rails (5.2.4.4)
+ actioncable (= 5.2.4.4)
+ actionmailer (= 5.2.4.4)
+ actionpack (= 5.2.4.4)
+ actionview (= 5.2.4.4)
+ activejob (= 5.2.4.4)
+ activemodel (= 5.2.4.4)
+ activerecord (= 5.2.4.4)
+ activestorage (= 5.2.4.4)
+ activesupport (= 5.2.4.4)
+ bundler (>= 1.3.0)
+ railties (= 5.2.4.4)
+ sprockets-rails (>= 2.0.0)
+ rails-controller-testing (1.0.5)
+ actionpack (>= 5.0.1.rc1)
+ actionview (>= 5.0.1.rc1)
+ activesupport (>= 5.0.1.rc1)
+ rails-dom-testing (2.0.3)
+ activesupport (>= 4.2.0)
+ nokogiri (>= 1.6)
rails-html-sanitizer (1.3.0)
loofah (~> 2.3)
- rails-i18n (4.0.3)
- i18n (~> 0.6)
- railties (~> 4.0)
- railties (4.2.11.3)
- actionpack (= 4.2.11.3)
- activesupport (= 4.2.11.3)
+ rails-i18n (5.1.3)
+ i18n (>= 0.7, < 2)
+ railties (>= 5.0, < 6)
+ railties (5.2.4.4)
+ actionpack (= 5.2.4.4)
+ activesupport (= 5.2.4.4)
+ method_source
rake (>= 0.8.7)
- thor (>= 0.18.1, < 2.0)
+ thor (>= 0.19.0, < 2.0)
rake (13.0.1)
rbnacl (4.0.2)
ffi
+ rbtree3 (0.6.0)
rdoc (6.2.1)
- redis (3.3.0)
+ redis (4.2.5)
ref (2.0.0)
regexp_parser (1.8.2)
render_csv (2.0.0)
rails (>= 3.0)
- responders (2.4.1)
- actionpack (>= 4.2.0, < 6.0)
- railties (>= 4.2.0, < 6.0)
- rest-client (1.8.0)
+ responders (3.0.1)
+ actionpack (>= 5.0)
+ railties (>= 5.0)
+ rest-client (2.1.0)
+ http-accept (>= 1.7.0, < 2.0)
http-cookie (>= 1.0.2, < 2.0)
- mime-types (>= 1.16, < 3.0)
- netrc (~> 0.7)
- rspec-activemodel-mocks (1.0.3)
+ mime-types (>= 1.16, < 4.0)
+ netrc (~> 0.8)
+ rspec-activemodel-mocks (1.1.0)
activemodel (>= 3.0)
activesupport (>= 3.0)
rspec-mocks (>= 2.99, < 4.0)
@@ -304,41 +329,44 @@ GEM
rspec-mocks (~> 3.9)
rspec-support (~> 3.9)
rspec-support (3.10.0)
+ ruby2_keywords (0.0.2)
ruby_parser (3.15.0)
sexp_processor (~> 4.9)
- safe_yaml (1.0.4)
- sass (3.2.13)
- sass-rails (4.0.1)
- railties (>= 4.0.0, < 5.0)
- sass (>= 3.1.10)
- sprockets-rails (~> 2.0.0)
- sawyer (0.8.1)
- addressable (>= 2.3.5, < 2.6)
- faraday (~> 0.8, < 1.0)
+ sass-rails (6.0.0)
+ sassc-rails (~> 2.1, >= 2.1.1)
+ sassc (2.4.0)
+ ffi (~> 1.9)
+ sassc-rails (2.1.2)
+ railties (>= 4.0.0)
+ sassc (>= 2.0)
+ sprockets (> 3.0)
+ sprockets-rails
+ tilt
+ sawyer (0.8.2)
+ addressable (>= 2.3.5)
+ faraday (> 0.8, < 2.0)
sdoc (2.0.2)
rdoc (>= 5.0)
sexp_processor (4.15.1)
- shoulda-matchers (3.1.1)
- activesupport (>= 4.0.0)
- sidekiq (4.0.2)
- concurrent-ruby (~> 1.0)
- connection_pool (~> 2.2, >= 2.2.0)
- redis (~> 3.2, >= 3.2.1)
+ shoulda-matchers (4.4.1)
+ activesupport (>= 4.2.0)
+ sidekiq (6.1.2)
+ connection_pool (>= 2.2.2)
+ rack (~> 2.0)
+ redis (>= 4.2.0)
simplecov (0.19.1)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov-html (0.12.3)
- sprockets (2.12.5)
- hike (~> 1.2)
- multi_json (~> 1.0)
- rack (~> 1.0)
- tilt (~> 1.1, != 1.3.0)
- sprockets-rails (2.0.1)
- actionpack (>= 3.0)
- activesupport (>= 3.0)
- sprockets (~> 2.8)
- sqlite3 (1.3.11)
- sshkit (1.12.0)
+ sprockets (4.0.2)
+ concurrent-ruby (~> 1.0)
+ rack (> 1, < 3)
+ sprockets-rails (3.2.2)
+ actionpack (>= 4.0)
+ activesupport (>= 4.0)
+ sprockets (>= 3.0.0)
+ sqlite3 (1.4.2)
+ sshkit (1.21.0)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
temple (0.8.2)
@@ -347,29 +375,32 @@ GEM
ref
thor (1.0.1)
thread_safe (0.3.6)
- tilt (1.4.1)
- turbolinks (2.5.3)
- coffee-rails
- twitter-bootstrap-rails (3.2.0)
- actionpack (~> 4.1)
- execjs (~> 2.2)
- rails (~> 4.1)
- railties (~> 4.1)
+ tilt (2.0.10)
+ turbolinks (5.2.1)
+ turbolinks-source (~> 5.2)
+ turbolinks-source (5.2.0)
+ twitter-bootstrap-rails (3.2.2)
+ actionpack (>= 3.1)
+ execjs (>= 2.2.2, >= 2.2)
+ less-rails (>= 2.5.0)
+ railties (>= 3.1)
tzinfo (1.2.8)
thread_safe (~> 0.1)
- uglifier (2.4.0)
- execjs (>= 0.3.0)
- json (>= 1.8.0)
+ uglifier (4.2.0)
+ execjs (>= 0.3.0, < 3)
unf (0.1.4)
unf_ext
- unf_ext (0.0.7.1)
- vcr (3.0.3)
- warden (1.2.7)
- rack (>= 1.0)
- webmock (3.1.0)
+ unf_ext (0.0.7.7)
+ vcr (6.0.0)
+ warden (1.2.9)
+ rack (>= 2.0.9)
+ webmock (3.10.0)
addressable (>= 2.3.6)
crack (>= 0.3.2)
- hashdiff
+ hashdiff (>= 0.4.0, < 2.0.0)
+ websocket-driver (0.7.3)
+ websocket-extensions (>= 0.1.0)
+ websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)
@@ -378,58 +409,58 @@ PLATFORMS
DEPENDENCIES
acts_as_paranoid
- airbrake (~> 3.1.15)
- bcrypt (~> 3.1.12)
+ airbrake
+ bcrypt
bcrypt_pbkdf (~> 1.0.0)
- bech32 (~> 1.0.5)
- bootstrap_form (~> 2.7.0)
+ bech32
+ bootstrap_form
cancancan
capistrano (~> 3.4.0)
capistrano-bundler (~> 1.1.2)
capistrano-rails (~> 1.1.0)
capistrano-rvm (~> 0.1.0)
- coffee-rails (~> 4.0.0)
+ coffee-rails
cucumber-rails (~> 1.0)
database_cleaner
demoji
- devise (~> 4.7.3)
+ devise
devise-i18n
- dusen (~> 0.6.1)
+ dusen
easy_gravatar
- factory_girl_rails (~> 4.3.0)
+ factory_bot_rails
haml-rails
http_accept_language
i18n-js
- jbuilder (~> 1.5.3)
+ jbuilder
jquery-rails
jquery-turbolinks
kaminari
kaminari-i18n
- less-rails (~> 2.4.2)
- money-tree (~> 0.10.0)
- mysql2 (~> 0.4.10)
- octokit (~> 4.7.0)
- omniauth (~> 1.9.1)
+ money-tree
+ mysql2
+ octokit
+ omniauth
omniauth-github
- rails (= 4.2.11.3)
- rails-i18n (~> 4.0.0)
+ rails (= 5.2.4.4)
+ rails-controller-testing
+ rails-i18n
rbnacl (< 5)
render_csv
rest-client
rspec-activemodel-mocks
- rspec-rails (~> 4.0)
- sass-rails (~> 4.0.0)
- sawyer (~> 0.8.0)
+ rspec-rails
+ sass-rails
+ sawyer
sdoc
- shoulda-matchers (~> 3.1)
+ shoulda-matchers
sidekiq
simplecov
- sprockets (~> 2.12.5)
- sqlite3 (~> 1.3.11)
- therubyracer (~> 0.12.2)
- turbolinks (~> 2.5.0)
+ sprockets
+ sqlite3
+ therubyracer
+ turbolinks
twitter-bootstrap-rails
- uglifier (>= 1.3.0)
+ uglifier
vcr
webmock
diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js
new file mode 100644
index 00000000..670e8d0e
--- /dev/null
+++ b/app/assets/config/manifest.js
@@ -0,0 +1,5 @@
+// app/assets/config/manifest.js
+//
+//= link application.css
+//
+//= link application.js
\ No newline at end of file
diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js
new file mode 100644
index 00000000..1732ea33
--- /dev/null
+++ b/app/assets/javascripts/application.js
@@ -0,0 +1,10 @@
+// This is a manifest file that'll be compiled into including all the files listed below.
+// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
+// be included in the compiled file accessible from http://example.com/assets/application.js
+// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
+// the compiled file.
+//
+//= require jquery
+//= require jquery_ujs
+//= require twitter/bootstrap
+//= require_tree .
diff --git a/app/assets/javascripts/bootstrap.js.coffee b/app/assets/javascripts/bootstrap.js.coffee
index f617be7e..94406798 100644
--- a/app/assets/javascripts/bootstrap.js.coffee
+++ b/app/assets/javascripts/bootstrap.js.coffee
@@ -1,3 +1,3 @@
-$(document).on "ready page:change", () ->
+jQuery ->
$("a[rel~=popover], .has-popover").popover()
- $("a[rel~=tooltip], .has-tooltip").tooltip()
\ No newline at end of file
+ $("a[rel~=tooltip], .has-tooltip").tooltip()
diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css
index 5c9d2b71..fb30baeb 100644
--- a/app/assets/stylesheets/application.css
+++ b/app/assets/stylesheets/application.css
@@ -30,3 +30,5 @@
}
.rjust { text-align: right ; }
+
+.qrcode { text-align: center; }
\ No newline at end of file
diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css b/app/assets/stylesheets/bootstrap_and_overrides.css
new file mode 100644
index 00000000..131fcfd7
--- /dev/null
+++ b/app/assets/stylesheets/bootstrap_and_overrides.css
@@ -0,0 +1,7 @@
+/*
+ =require twitter-bootstrap-static/bootstrap
+
+ Use Font Awesome icons (default)
+ To use Glyphicons sprites instead of Font Awesome, replace with "require twitter-bootstrap-static/sprites"
+ =require twitter-bootstrap-static/fontawesome
+ */
\ No newline at end of file
diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css.less b/app/assets/stylesheets/bootstrap_and_overrides.css.less
deleted file mode 100644
index 9c3ec0d1..00000000
--- a/app/assets/stylesheets/bootstrap_and_overrides.css.less
+++ /dev/null
@@ -1,30 +0,0 @@
-@import "twitter/bootstrap/bootstrap";
-
-// Set the correct sprite paths
-@iconSpritePath: image-url("twitter/bootstrap/glyphicons-halflings.png");
-@iconWhiteSpritePath: image-url("twitter/bootstrap/glyphicons-halflings-white.png");
-
-// Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines)
-@fontAwesomeEotPath: asset-url("fontawesome-webfont.eot");
-@fontAwesomeEotPath_iefix: asset-url("fontawesome-webfont.eot?#iefix");
-@fontAwesomeWoffPath: asset-url("fontawesome-webfont.woff");
-@fontAwesomeTtfPath: asset-url("fontawesome-webfont.ttf");
-@fontAwesomeSvgPath: asset-url("fontawesome-webfont.svg#fontawesomeregular");
-
-// Font Awesome
-@import "fontawesome/font-awesome";
-
-// Glyphicons
-//@import "twitter/bootstrap/sprites.less";
-
-// Your custom LESS stylesheets goes here
-//
-// Since bootstrap was imported above you have access to its mixins which
-// you may use and inherit here
-//
-// If you'd like to override bootstrap's own variables, you can do so here as well
-// See http://twitter.github.com/bootstrap/customize.html#variables for their names and documentation
-//
-// Example:
-// @linkColor: #ff0000;
-.qrcode {text-align:center}
\ No newline at end of file
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 0c334652..c7b4c9b0 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -7,7 +7,7 @@ class ApplicationController < ActionController::Base
redirect_to root_path, :alert => I18n.t('errors.access_denied')
end
- before_filter :load_locale
+ before_action :load_locale
private
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index a398b242..f4918332 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -3,8 +3,8 @@
class ProjectsController < ApplicationController
include ProjectsHelper
- before_filter :load_project, only: [:show, :edit, :update, :decide_tip_amounts]
- before_filter :redirect_to_pretty_url, only: [:show, :edit, :decide_tip_amounts]
+ before_action :load_project, only: [:show, :edit, :update, :decide_tip_amounts]
+ before_action :redirect_to_pretty_url, only: [:show, :edit, :decide_tip_amounts]
def index
@projects = Project.order(projects_order).page(params[:page]).per(30)
diff --git a/app/controllers/tips_controller.rb b/app/controllers/tips_controller.rb
index 333fcf22..4ef657ed 100644
--- a/app/controllers/tips_controller.rb
+++ b/app/controllers/tips_controller.rb
@@ -1,6 +1,6 @@
class TipsController < ApplicationController
- before_filter { load_project params }
- before_filter { load_user params }
+ before_action { load_project params }
+ before_action { load_user params }
def index
if @project.present?
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index db3258a6..adab2893 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -1,6 +1,6 @@
class UsersController < ApplicationController
before_action :authenticate_user!, :load_user, :valid_user!, except: [:login, :index]
- before_filter :redirect_to_pretty_url, only: [:show]
+ before_action :redirect_to_pretty_url, only: [:show]
def show
@user_tips = @user.tips
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index c7cec444..1bb9cba0 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -37,4 +37,8 @@ def pretty_project_url project
def shield_url project
project_url project, format: :svg
end
+
+ def permitted_params
+ params.permit(:order, :page)
+ end
end
diff --git a/app/models/application_record.rb b/app/models/application_record.rb
new file mode 100644
index 00000000..863c094d
--- /dev/null
+++ b/app/models/application_record.rb
@@ -0,0 +1,3 @@
+class ApplicationRecord < ActiveRecord::Base
+ self.abstract_class = true
+end
diff --git a/app/models/collaborator.rb b/app/models/collaborator.rb
index 3c0e6f15..bb929bca 100644
--- a/app/models/collaborator.rb
+++ b/app/models/collaborator.rb
@@ -1,3 +1,3 @@
-class Collaborator < ActiveRecord::Base
+class Collaborator < ApplicationRecord
belongs_to :project
end
diff --git a/app/models/deposit.rb b/app/models/deposit.rb
index 6dfba0c9..125b306b 100644
--- a/app/models/deposit.rb
+++ b/app/models/deposit.rb
@@ -1,4 +1,4 @@
-class Deposit < ActiveRecord::Base
+class Deposit < ApplicationRecord
belongs_to :project
CONFIRMATIONS_NEEDED = 3
diff --git a/app/models/project.rb b/app/models/project.rb
index b1d9f580..b0ba3a47 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -1,4 +1,4 @@
-class Project < ActiveRecord::Base
+class Project < ApplicationRecord
acts_as_paranoid
belongs_to :wallet
diff --git a/app/models/sendmany.rb b/app/models/sendmany.rb
index d42aa3d7..bda180b4 100644
--- a/app/models/sendmany.rb
+++ b/app/models/sendmany.rb
@@ -1,4 +1,4 @@
-class Sendmany < ActiveRecord::Base
+class Sendmany < ApplicationRecord
has_many :tips
def total_amount
diff --git a/app/models/tip.rb b/app/models/tip.rb
index 4620d4e5..120859c6 100644
--- a/app/models/tip.rb
+++ b/app/models/tip.rb
@@ -1,4 +1,4 @@
-class Tip < ActiveRecord::Base
+class Tip < ApplicationRecord
belongs_to :user
belongs_to :sendmany
belongs_to :project, inverse_of: :tips
diff --git a/app/models/tipping_policies_text.rb b/app/models/tipping_policies_text.rb
index eaf490f2..5e6a3a55 100644
--- a/app/models/tipping_policies_text.rb
+++ b/app/models/tipping_policies_text.rb
@@ -1,4 +1,4 @@
-class TippingPoliciesText < ActiveRecord::Base
+class TippingPoliciesText < ApplicationRecord
belongs_to :project
belongs_to :user
end
diff --git a/app/models/user.rb b/app/models/user.rb
index 839b6d7e..6dbbe3c4 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -1,4 +1,4 @@
-class User < ActiveRecord::Base
+class User < ApplicationRecord
# Include default devise modules. Others available are:
# :lockable, :timeoutable
devise :database_authenticatable, :registerable, :recoverable,
diff --git a/app/models/wallet.rb b/app/models/wallet.rb
index 31eb4fb5..20d6de30 100644
--- a/app/models/wallet.rb
+++ b/app/models/wallet.rb
@@ -1,4 +1,4 @@
-class Wallet < ActiveRecord::Base
+class Wallet < ApplicationRecord
validates :name, :xpub, presence: true
diff --git a/app/views/devise/confirmations/new.html.haml b/app/views/devise/confirmations/new.html.haml
index 9dde55ad..4cbba835 100644
--- a/app/views/devise/confirmations/new.html.haml
+++ b/app/views/devise/confirmations/new.html.haml
@@ -2,6 +2,6 @@
%h2= t('.title')
= devise_error_messages!
= f.email_field :email, :autofocus => true
- = f.submit t('.submit')
+ = f.submit t('.submit'), class: 'btn btn-primary'
%p
= render "devise/shared/links"
diff --git a/app/views/devise/passwords/edit.html.haml b/app/views/devise/passwords/edit.html.haml
index bdf65f15..024a7f6d 100644
--- a/app/views/devise/passwords/edit.html.haml
+++ b/app/views/devise/passwords/edit.html.haml
@@ -4,6 +4,6 @@
= f.hidden_field :reset_password_token
= f.password_field :password, :autofocus => true, :autocomplete => "off"
= f.password_field :password_confirmation, :autocomplete => "off"
- = f.submit t('.submit')
+ = f.submit t('.submit'), class: 'btn btn-primary'
%p
= render "devise/shared/links"
diff --git a/app/views/devise/passwords/new.html.haml b/app/views/devise/passwords/new.html.haml
index 2785390c..ff2947a9 100644
--- a/app/views/devise/passwords/new.html.haml
+++ b/app/views/devise/passwords/new.html.haml
@@ -2,6 +2,6 @@
%h2= t('.title')
= devise_error_messages!
= f.email_field :email, :autofocus => true
- = f.submit t('.submit')
+ = f.submit t('.submit'), class: 'btn btn-primary'
%p
= render "devise/shared/links"
diff --git a/app/views/devise/registrations/edit.html.haml b/app/views/devise/registrations/edit.html.haml
index a39e9c5b..cf5a8ac5 100644
--- a/app/views/devise/registrations/edit.html.haml
+++ b/app/views/devise/registrations/edit.html.haml
@@ -20,7 +20,7 @@
%i (we need your current password to confirm your changes)
%br/
= f.password_field :current_password, :autocomplete => "off"
- %div= f.submit "Update"
+ %div= f.submit "Update", class: 'btn btn-primary'
%p
%h3 Cancel my account
%p
diff --git a/app/views/devise/registrations/new.html.haml b/app/views/devise/registrations/new.html.haml
index 09c797b0..1a00b84d 100644
--- a/app/views/devise/registrations/new.html.haml
+++ b/app/views/devise/registrations/new.html.haml
@@ -4,6 +4,6 @@
= f.email_field :email, :autofocus => true
= f.password_field :password, :autocomplete => "off"
= f.password_field :password_confirmation, :autocomplete => "off"
- = f.submit t('.submit')
+ = f.submit t('.submit'), class: 'btn btn-primary'
%p
= render "devise/shared/links"
diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml
index 45f1cff3..fc647f00 100644
--- a/app/views/devise/sessions/new.html.haml
+++ b/app/views/devise/sessions/new.html.haml
@@ -6,6 +6,6 @@
- if devise_mapping.rememberable?
%div
= f.check_box :remember_me, label: t('.remember_me')
- = f.submit t('.submit')
+ = f.submit t('.submit'), class: 'btn btn-primary'
%p
= render "devise/shared/links"
diff --git a/app/views/projects/decide_tip_amounts.html.haml b/app/views/projects/decide_tip_amounts.html.haml
index 423d65fe..f20dcebd 100644
--- a/app/views/projects/decide_tip_amounts.html.haml
+++ b/app/views/projects/decide_tip_amounts.html.haml
@@ -19,4 +19,4 @@
= tip_fields.radio_button :amount_percentage, amount[1], inline: true, label: t(amount[0], scope: 'tip_amounts')
.text-center
- = f.submit t('.submit')
+ = f.submit t('.submit'), class: 'btn btn-primary'
diff --git a/app/views/projects/index.html.haml b/app/views/projects/index.html.haml
index 659b7ba0..0638032d 100644
--- a/app/views/projects/index.html.haml
+++ b/app/views/projects/index.html.haml
@@ -15,10 +15,10 @@
%thead
%tr
%th
- %th= link_to_unless_current t('.repository'), params.merge(:order => 'repository')
- %th= link_to_unless_current t('.description'), params.merge(:order => 'description')
- %th= link_to_unless_current t('.watchers'), params.merge(:order => 'watchers')
- %th= link_to_unless params[:order].blank? || params[:order] == 'balance', t('.balance'), params.merge(:order => 'balance')
+ %th= link_to_unless_current t('.repository'), permitted_params.merge(:order => 'repository')
+ %th= link_to_unless_current t('.description'), permitted_params.merge(:order => 'description')
+ %th= link_to_unless_current t('.watchers'), permitted_params.merge(:order => 'watchers')
+ %th= link_to_unless params[:order].blank? || params[:order] == 'balance', t('.balance'), permitted_params.merge(:order => 'balance')
%th
%tbody
- @projects.to_a.reject{|p| BLACKLIST.include?(p.github_url) }.each do |project|
diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml
index 3f1e932f..44b97a64 100644
--- a/app/views/users/show.html.haml
+++ b/app/views/users/show.html.haml
@@ -35,7 +35,7 @@
- if f.object.bitcoin_address.blank?
= f.check_box :unsubscribed, { label: t('.notify'), checked: !f.object.unsubscribed? }, '0', '1'
%br
- = f.submit t('.submit_user')
+ = f.submit t('.submit_user'), class: 'btn btn-primary'
%br
%p
%strong= link_to t('.change_password'), '#new_password_form', data: {toggle: "collapse"}
@@ -44,7 +44,7 @@
= hidden_field_tag :new_password, value: true
= f.password_field :password, autofocus: true, autocomplete: "off"
= f.password_field :password_confirmation, autocomplete: "off"
- = f.submit t('.submit_password')
+ = f.submit t('.submit_password'), class: 'btn btn-primary'
%br
%p
diff --git a/config/application.rb b/config/application.rb
index b91bb912..d700c1f9 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -27,8 +27,7 @@ class Application < Rails::Application
config.assets.initialize_on_precompile = true
config.available_locales = %w[en es fr nl ru pl hr de ro ko id ja pt my cn hk]
config.active_job.queue_adapter = :sidekiq
-
- config.active_record.raise_in_transactional_callbacks = true
+ config.active_record.sqlite3.represent_boolean_as_integer = true
end
end
diff --git a/config/environments/development.rb b/config/environments/development.rb
index 42389197..3e5e8255 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -28,4 +28,6 @@
# This option may cause significant delays in view rendering with a large
# number of complex assets.
config.assets.debug = true
+
+ config.assets.check_precompiled_asset = false
end
diff --git a/config/environments/test.rb b/config/environments/test.rb
index 70a0d8f5..a24b44ba 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -36,4 +36,6 @@
# Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr
+
+ config.assets.check_precompiled_asset = false
end
diff --git a/config/locales/en.bootstrap.yml b/config/locales/en.bootstrap.yml
new file mode 100644
index 00000000..8d751190
--- /dev/null
+++ b/config/locales/en.bootstrap.yml
@@ -0,0 +1,23 @@
+# Sample localization file for English. Add more files in this directory for other locales.
+# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
+
+en:
+ breadcrumbs:
+ application:
+ root: "Index"
+ pages:
+ pages: "Pages"
+ helpers:
+ actions: "Actions"
+ links:
+ back: "Back"
+ cancel: "Cancel"
+ confirm: "Are you sure?"
+ destroy: "Delete"
+ new: "New"
+ edit: "Edit"
+ titles:
+ edit: "Edit %{model}"
+ save: "Save %{model}"
+ new: "New %{model}"
+ delete: "Delete %{model}"
diff --git a/db/schema.rb b/db/schema.rb
index 43f56a9d..3e91d974 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -14,25 +14,25 @@
ActiveRecord::Schema.define(version: 20170308163825) do
create_table "collaborators", force: :cascade do |t|
- t.integer "project_id"
+ t.integer "project_id", limit: 4
t.string "login", limit: 255
t.datetime "created_at"
t.datetime "updated_at"
end
- add_index "collaborators", ["project_id"], name: "index_collaborators_on_project_id"
+ add_index "collaborators", ["project_id"], name: "index_collaborators_on_project_id", using: :btree
create_table "deposits", force: :cascade do |t|
- t.integer "project_id"
+ t.integer "project_id", limit: 4
t.string "txid", limit: 255
- t.integer "confirmations"
+ t.integer "confirmations", limit: 4
t.datetime "created_at"
t.datetime "updated_at"
t.integer "amount", limit: 8
- t.float "fee_size"
+ t.float "fee_size", limit: 24
end
- add_index "deposits", ["project_id"], name: "index_deposits_on_project_id"
+ add_index "deposits", ["project_id"], name: "index_deposits_on_project_id", using: :btree
create_table "projects", force: :cascade do |t|
t.string "url", limit: 255
@@ -42,30 +42,30 @@
t.string "name", limit: 255
t.string "full_name", limit: 255
t.string "source_full_name", limit: 255
- t.text "description"
- t.integer "watchers_count"
+ t.text "description", limit: 65535
+ t.integer "watchers_count", limit: 4
t.string "language", limit: 255
t.string "last_commit", limit: 255
- t.integer "available_amount_cache"
+ t.integer "available_amount_cache", limit: 4
t.string "github_id", limit: 255
- t.string "host", limit: 255, default: "github"
- t.boolean "hold_tips", default: false
+ t.string "host", limit: 255, default: "github"
+ t.boolean "hold_tips", default: false
t.datetime "info_updated_at"
t.string "branch", limit: 255
t.boolean "disable_notifications"
t.string "avatar_url", limit: 255
t.datetime "deleted_at"
- t.string "bitcoin_address2"
- t.integer "wallet_id"
- t.string "legacy_address"
+ t.string "bitcoin_address2", limit: 255
+ t.integer "wallet_id", limit: 4
+ t.string "legacy_address", limit: 255
end
- add_index "projects", ["full_name"], name: "index_projects_on_full_name", unique: true
- add_index "projects", ["github_id"], name: "index_projects_on_github_id", unique: true
+ add_index "projects", ["full_name"], name: "index_projects_on_full_name", unique: true, using: :btree
+ add_index "projects", ["github_id"], name: "index_projects_on_github_id", unique: true, using: :btree
create_table "sendmanies", force: :cascade do |t|
t.string "txid", limit: 255
- t.text "data"
+ t.text "data", limit: 65535
t.string "result", limit: 255
t.boolean "is_error"
t.datetime "created_at"
@@ -73,32 +73,32 @@
end
create_table "tipping_policies_texts", force: :cascade do |t|
- t.integer "project_id"
- t.integer "user_id"
- t.text "text"
+ t.integer "project_id", limit: 4
+ t.integer "user_id", limit: 4
+ t.text "text", limit: 65535
t.datetime "created_at"
t.datetime "updated_at"
end
- add_index "tipping_policies_texts", ["project_id"], name: "index_tipping_policies_texts_on_project_id"
- add_index "tipping_policies_texts", ["user_id"], name: "index_tipping_policies_texts_on_user_id"
+ add_index "tipping_policies_texts", ["project_id"], name: "index_tipping_policies_texts_on_project_id", using: :btree
+ add_index "tipping_policies_texts", ["user_id"], name: "index_tipping_policies_texts_on_user_id", using: :btree
create_table "tips", force: :cascade do |t|
- t.integer "user_id"
+ t.integer "user_id", limit: 4
t.integer "amount", limit: 8
- t.integer "sendmany_id"
+ t.integer "sendmany_id", limit: 4
t.datetime "created_at"
t.datetime "updated_at"
t.string "commit", limit: 255
- t.integer "project_id"
+ t.integer "project_id", limit: 4
t.datetime "refunded_at"
- t.text "commit_message"
+ t.text "commit_message", limit: 65535
t.datetime "decided_at"
end
- add_index "tips", ["project_id"], name: "index_tips_on_project_id"
- add_index "tips", ["sendmany_id"], name: "index_tips_on_sendmany_id"
- add_index "tips", ["user_id"], name: "index_tips_on_user_id"
+ add_index "tips", ["project_id"], name: "index_tips_on_project_id", using: :btree
+ add_index "tips", ["sendmany_id"], name: "index_tips_on_sendmany_id", using: :btree
+ add_index "tips", ["user_id"], name: "index_tips_on_user_id", using: :btree
create_table "users", force: :cascade do |t|
t.string "email", limit: 255, default: "", null: false
@@ -106,7 +106,7 @@
t.string "reset_password_token", limit: 255
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
- t.integer "sign_in_count", default: 0, null: false
+ t.integer "sign_in_count", limit: 4, default: 0, null: false
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.string "current_sign_in_ip", limit: 255
@@ -120,25 +120,25 @@
t.string "login_token", limit: 255
t.boolean "unsubscribed"
t.datetime "notified_at"
- t.integer "commits_count", default: 0
+ t.integer "commits_count", limit: 4, default: 0
t.integer "withdrawn_amount", limit: 8, default: 0
t.datetime "confirmed_at"
t.datetime "confirmation_sent_at"
t.string "confirmation_token", limit: 255
t.string "unconfirmed_email", limit: 255
t.string "display_name", limit: 255
- t.integer "denom", default: 0
+ t.integer "denom", limit: 4, default: 0
end
- add_index "users", ["email"], name: "index_users_on_email", unique: true
- add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
+ add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree
+ add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree
create_table "wallets", force: :cascade do |t|
- t.string "name"
- t.string "xpub"
- t.integer "last_address_index", limit: 4, default: 1
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.string "name", limit: 255
+ t.string "xpub", limit: 255
+ t.integer "last_address_index", limit: 4, default: 1
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
end
end
diff --git a/features/step_definitions/users_steps.rb b/features/step_definitions/users_steps.rb
index 1a700918..7a32a93b 100644
--- a/features/step_definitions/users_steps.rb
+++ b/features/step_definitions/users_steps.rb
@@ -1,5 +1,5 @@
-def create_user nickname , has_bitcoiin_address
+def create_user(nickname, has_bitcoiin_address)
User.create do |user|
user.name = nickname
user.email = "#{nickname}@example.com"
@@ -10,8 +10,9 @@ def create_user nickname , has_bitcoiin_address
end
end
-Given /^a developer named "(.*?)" exists (with|without?) a bitcoin address$/ do |nickname , with|
- (@users ||= {})[nickname] ||= (create_user nickname , (with.eql? 'with'))
+Given /^a developer named "(.*?)" exists (with|without) a bitcoin address$/ do |nickname, with|
+ @users ||= {}
+ @users[nickname] ||= create_user(nickname, with.eql?('with'))
end
Then /^a developer named "(.*?)" does not exist$/ do |nickname|
diff --git a/features/support/factory_bot.rb b/features/support/factory_bot.rb
new file mode 100644
index 00000000..168f5ac1
--- /dev/null
+++ b/features/support/factory_bot.rb
@@ -0,0 +1 @@
+World(FactoryBot::Syntax::Methods)
diff --git a/features/support/factory_girl.rb b/features/support/factory_girl.rb
deleted file mode 100644
index 139fbe01..00000000
--- a/features/support/factory_girl.rb
+++ /dev/null
@@ -1 +0,0 @@
-World(FactoryGirl::Syntax::Methods)
diff --git a/spec/controllers/deposits_controller_spec.rb b/spec/controllers/deposits_controller_spec.rb
index 750b6980..57de087c 100644
--- a/spec/controllers/deposits_controller_spec.rb
+++ b/spec/controllers/deposits_controller_spec.rb
@@ -4,7 +4,7 @@
describe "GET 'index'" do
it "returns http success" do
get 'index'
- expect(response).to be_success
+ expect(response).to be_successful
end
end
diff --git a/spec/controllers/projects_controller_spec.rb b/spec/controllers/projects_controller_spec.rb
index 24b24018..3c3b5f59 100644
--- a/spec/controllers/projects_controller_spec.rb
+++ b/spec/controllers/projects_controller_spec.rb
@@ -42,7 +42,7 @@
describe 'GET #search' do
context 'with existing repo that has been blacklisted' do
- let(:subject) { get :search, query: "https://github.com/mitsuhiko/flask" }
+ let(:subject) { get(:search, params: { query: 'https://github.com/mitsuhiko/flask' }) }
it 'renders blacklisted template' do
expect(subject).to render_template :blacklisted
@@ -53,7 +53,7 @@
describe 'POST #search' do
it 'returns 200 status code' do
post :search
- expect(response).to be_success
+ expect(response).to be_successful
end
end
@@ -72,34 +72,42 @@
context 'existing_project' do
it 'via project id returns 302 status code' do
case verb
- when :get ; get action , :id => a_project.id
- when :patch ; patch action , :id => a_project.id
+ when :get
+ get(action, params: { id: a_project.id })
+ when :patch
+ patch(action, params: { id: a_project.id })
end
expect(response).to be_redirect
end
it 'via project name returns 200 status code' do
case verb
- when :get ; get action , :service => 'github' , :repo => a_project.full_name
- when :patch ; patch action , :service => 'github' , :repo => a_project.full_name
+ when :get
+ get(action, params: { service: 'github', repo: a_project.full_name })
+ when :patch
+ patch(action, params: { service: 'github', repo: a_project.full_name})
end
- expect(response).to be_success
+ expect(response).to be_successful
end
end
context 'nonexisting_project' do
it 'via project id returns 302 status code' do
case verb
- when :get ; get action , :id => 999999
- when :patch ; patch action , :id => 999999
+ when :get
+ get(action, params: { id: 999999 })
+ when :patch
+ patch(action, params: { id: 999999 })
end
expect(response).to be_redirect
end
it 'via project name returns 200 status code' do
case verb
- when :get ; get action , :service => 'github' , :repo => 'no-such/project' ;
- when :patch ; patch action , :service => 'github' , :repo => 'no-such/project' ;
+ when :get
+ get(action, params: { service: 'github', repo: 'no-such/project' })
+ when :patch
+ patch(action, params: { service: 'github', repo: 'no-such/project' })
end
expect(response).to be_redirect
end
@@ -111,7 +119,7 @@
context 'with existing repo that has been blacklisted' do
let(:blacklisted_repo) { create(:project, host: "github", full_name: "mitsuhiko/flask") }
- let(:subject) { get :show, service: "github", repo: blacklisted_repo.full_name }
+ let(:subject) { get(:show, params: { service: "github", repo: blacklisted_repo.full_name }) }
it 'renders blacklisted template' do
expect(subject).to render_template :blacklisted
@@ -124,7 +132,7 @@
# TODO: requires logged in user who is project collaborator
# include_context 'accessing_project' , :get , :edit
- get :edit , :service => 'github' , :repo => 'test/test'
+ get(:edit, params: { service: 'github' , repo: 'test/test' })
expect(response).to be_redirect
end
end
@@ -134,7 +142,7 @@
# include_context 'accessing_project' , :get , :decide_tip_amounts
it 'returns 302 status code' do
- get :decide_tip_amounts , :service => 'github' , :repo => 'test/test'
+ get(:decide_tip_amounts, params: { service: 'github', repo: 'test/test' })
expect(response).to be_redirect
end
end
@@ -144,7 +152,7 @@
# include_context 'accessing_project' , :patch , :decide_tip_amounts
it 'returns 302 status code' do
- patch :decide_tip_amounts , :service => 'github' , :repo => 'test/test'
+ patch(:decide_tip_amounts, params: { service: 'github' , repo: 'test/test' })
expect(response).to be_redirect
end
end
diff --git a/spec/controllers/tips_controller_spec.rb b/spec/controllers/tips_controller_spec.rb
index 2453dbe3..60385bcb 100644
--- a/spec/controllers/tips_controller_spec.rb
+++ b/spec/controllers/tips_controller_spec.rb
@@ -4,7 +4,7 @@
describe "GET 'index'" do
it "returns http success" do
get 'index'
- expect(response).to be_success
+ expect(response).to be_successful
end
end
diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb
index 3d45dd35..a33c9f14 100644
--- a/spec/controllers/users_controller_spec.rb
+++ b/spec/controllers/users_controller_spec.rb
@@ -19,10 +19,8 @@
end
describe '#show' do
-# let(:user) { mock_model User, id: 100000000 }
-# let(:subject) { get :show, id: user.id }
let(:user) { create(:user) }
- let(:subject) { get :show , :nickname => user.nickname }
+ let(:subject) { get(:show, params: { nickname: user.nickname }) }
context 'when logged in' do
login_user
@@ -56,7 +54,7 @@
context 'when viewing other\'s page' do
let(:new_user) { create(:user) }
- let(:subject) { get :show, id: new_user.id }
+ let(:subject) { get(:show, params: { id: new_user.id }) }
it 'redirect to root_path' do
expect(subject).to redirect_to root_path
@@ -70,7 +68,7 @@
end
context 'when user not found' do
- let(:subject) { get :show , :nickname => 'unknown-user' }
+ let(:subject) { get(:show, params: { nickname: 'unknown-user' }) }
it 'redirect to users_path' do
expect(subject).to redirect_to users_path
diff --git a/spec/controllers/withdrawals_controller_spec.rb b/spec/controllers/withdrawals_controller_spec.rb
index 226ec708..1e1cab44 100644
--- a/spec/controllers/withdrawals_controller_spec.rb
+++ b/spec/controllers/withdrawals_controller_spec.rb
@@ -4,7 +4,7 @@
describe "GET 'index'" do
it "returns http success" do
get 'index'
- expect(response).to be_success
+ expect(response).to be_successful
end
end
diff --git a/spec/factories/deposit.rb b/spec/factories/deposit.rb
index e76681b0..6b30af0f 100644
--- a/spec/factories/deposit.rb
+++ b/spec/factories/deposit.rb
@@ -1,8 +1,8 @@
-FactoryGirl.define do
+FactoryBot.define do
factory :deposit do
- association :project
- txid "txid"
- confirmations 1
- amount 100
+ association(:project)
+ txid { 'txid' }
+ confirmations { 1 }
+ amount { 100 }
end
end
diff --git a/spec/factories/project.rb b/spec/factories/project.rb
index 1c6657d5..4e77733d 100644
--- a/spec/factories/project.rb
+++ b/spec/factories/project.rb
@@ -1,15 +1,15 @@
-FactoryGirl.define do
+FactoryBot.define do
factory :project do
- url "MyString"
- full_name "test/test"
- github_id "1234567890"
+ url { 'MyString' }
+ full_name { 'test/test' }
+ github_id { '1234567890' }
trait :github do
- host 'github'
+ host { 'github' }
end
trait :bitbucket do
- host 'bitbucket'
+ host { 'bitbucket' }
end
end
end
diff --git a/spec/factories/sendmany.rb b/spec/factories/sendmany.rb
index 6cf19257..4d782279 100644
--- a/spec/factories/sendmany.rb
+++ b/spec/factories/sendmany.rb
@@ -1,8 +1,8 @@
-FactoryGirl.define do
+FactoryBot.define do
factory :sendmany do
- txid "txid"
- data "MyText"
- result "MyString"
- is_error false
+ txid { 'txid' }
+ data { 'MyText' }
+ result { 'MyString' }
+ is_error { false }
end
end
diff --git a/spec/factories/tip.rb b/spec/factories/tip.rb
index 4107159e..e7877b9e 100644
--- a/spec/factories/tip.rb
+++ b/spec/factories/tip.rb
@@ -1,12 +1,12 @@
-FactoryGirl.define do
+FactoryBot.define do
factory :tip do
- association :user
- association :project
- amount 1
+ association(:user)
+ association(:project)
+ amount { 1 }
commit { Digest::SHA1.hexdigest(SecureRandom.hex) }
factory :undecided_tip do
- amount nil
+ amount { nil }
end
end
end
diff --git a/spec/factories/user.rb b/spec/factories/user.rb
index de2ee3db..0fb99524 100644
--- a/spec/factories/user.rb
+++ b/spec/factories/user.rb
@@ -1,9 +1,9 @@
-FactoryGirl.define do
+FactoryBot.define do
factory :user do
sequence(:email) { |n| "test#{n}@gmail.com" }
- password "password"
- login_token "login_token"
- name 'kd'
- nickname 'kd'
+ password { 'password' }
+ login_token { 'login_token' }
+ name { 'kd' }
+ nickname { 'kd' }
end
end
diff --git a/spec/factories/wallets.rb b/spec/factories/wallets.rb
index 9729b730..f47103bd 100644
--- a/spec/factories/wallets.rb
+++ b/spec/factories/wallets.rb
@@ -1,7 +1,9 @@
-FactoryGirl.define do
+FactoryBot.define do
factory :wallet do
- name 'test wallet'
- xpub 'xpub661MyMwAqRbcFepxYZyGLKMTkTPDvbfLaoYDbw4d4iQT5SycGiJQREuraJ2N6Uh' \
- 'LGPcjXDhnARdtcUhgqN3a2dgQ3Dx8u1chtk8Rx16LrWg'
+ name { 'test wallet' }
+ xpub do
+ 'xpub661MyMwAqRbcFepxYZyGLKMTkTPDvbfLaoYDbw4d4iQT5SycGiJQREuraJ2N6Uh' \
+ 'LGPcjXDhnARdtcUhgqN3a2dgQ3Dx8u1chtk8Rx16LrWg'
+ end
end
end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 033570ea..d3706ea5 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -55,7 +55,7 @@
# --seed 1234
config.order = "random"
- include FactoryGirl::Syntax::Methods
+ include FactoryBot::Syntax::Methods
config.include Devise::Test::ControllerHelpers, type: :controller
config.extend ControllerMacros, type: :controller
end
From 6f9944560956fd6dd372e26deb420227d228ca22 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sat, 21 Nov 2020 08:39:24 +0100
Subject: [PATCH 063/159] Added docker-compose for dev environment
---
docker-compose.yaml | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 docker-compose.yaml
diff --git a/docker-compose.yaml b/docker-compose.yaml
new file mode 100644
index 00000000..d03b2e74
--- /dev/null
+++ b/docker-compose.yaml
@@ -0,0 +1,11 @@
+version: '2'
+services:
+ database:
+ image: mysql:5.5.62
+ ports:
+ - '3306:3306'
+ environment:
+ MYSQL_ROOT_PASSWORD: password
+ MYSQL_DATABASE: tip4commit
+ MYSQL_USER: tip4commit
+ MYSQL_PASSWORD: password
From 878ca1dfe17811b40c232f1bf6b466cd547bf131 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sat, 21 Nov 2020 09:20:12 +0100
Subject: [PATCH 064/159] Specified migration version
---
db/migrate/20131019133109_devise_create_users.rb | 2 +-
db/migrate/20131019133235_add_columns_to_users.rb | 2 +-
db/migrate/20131019144930_add_bitcoin_address_to_users.rb | 2 +-
db/migrate/20131019164745_create_projects.rb | 2 +-
db/migrate/20131019170122_create_deposits.rb | 2 +-
db/migrate/20131019170659_create_sendmanies.rb | 2 +-
db/migrate/20131019170925_create_tips.rb | 2 +-
db/migrate/20131019175751_add_some_fields_to_projects.rb | 2 +-
db/migrate/20131019205025_add_amount_to_deposit.rb | 2 +-
db/migrate/20131019211518_add_last_commit_to_projects.rb | 2 +-
db/migrate/20131020003746_add_commit_to_tip.rb | 2 +-
db/migrate/20131020120722_add_login_token_to_users.rb | 2 +-
db/migrate/20131020143021_add_unsubscribed_to_users.rb | 2 +-
db/migrate/20131020145043_add_notified_at_to_users.rb | 2 +-
db/migrate/20131030142320_add_project_to_tip.rb | 2 +-
db/migrate/20131030142749_drop_deposit_from_tip.rb | 2 +-
.../20131030191346_add_available_amount_cache_to_projects.rb | 2 +-
db/migrate/20131212190037_add_cache_to_users.rb | 2 +-
db/migrate/20140102095035_add_refunded_at_to_tips.rb | 2 +-
db/migrate/20140207061855_add_github_id_to_projects.rb | 2 +-
db/migrate/20140209022632_change_projects_description.rb | 2 +-
db/migrate/20140209041123_create_indexes_for_projects.rb | 2 +-
db/migrate/20140223061035_add_project_host.rb | 2 +-
db/migrate/20140309192616_create_collaborators.rb | 2 +-
db/migrate/20140323072851_add_hold_tips_to_project.rb | 2 +-
db/migrate/20140323165816_add_commit_message_to_tip.rb | 2 +-
db/migrate/20140323173320_create_tipping_policies_texts.rb | 2 +-
db/migrate/20140402032836_change_commit_message_type.rb | 2 +-
db/migrate/20140402034521_change_commit_message_limit.rb | 2 +-
db/migrate/20140402082149_add_fee_size_to_deposits.rb | 2 +-
db/migrate/20140620123610_add_decided_at_to_tips.rb | 2 +-
.../20140620124628_update_decided_at_for_existing_tips.rb | 2 +-
db/migrate/20140717085945_add_info_updated_at_to_projects.rb | 2 +-
db/migrate/20140722092532_add_confirmation_fields_to_users.rb | 2 +-
db/migrate/20140725054216_add_display_name_to_users.rb | 2 +-
db/migrate/20140816062159_remove_paid_out_from_deposits.rb | 2 +-
db/migrate/20140823035950_add_branch_to_projects.rb | 2 +-
db/migrate/20140823060921_make_default_branch_blank.rb | 2 +-
.../20140918051752_add_disable_notifications_to_projects.rb | 2 +-
db/migrate/20141029083726_add_avatar_to_projects.rb | 2 +-
db/migrate/20141112064004_add_deleted_at_to_projects.rb | 2 +-
db/migrate/20150620054216_add_denom.rb | 2 +-
db/migrate/20151219081507_add_bitcoin_address2_to_projects.rb | 2 +-
db/migrate/20170308152313_create_wallets.rb | 2 +-
db/migrate/20170308161814_add_wallet_id_to_projects.rb | 2 +-
db/migrate/20170308163825_add_legacy_addresses_to_projects.rb | 2 +-
46 files changed, 46 insertions(+), 46 deletions(-)
diff --git a/db/migrate/20131019133109_devise_create_users.rb b/db/migrate/20131019133109_devise_create_users.rb
index ab71c3d1..60dff55e 100644
--- a/db/migrate/20131019133109_devise_create_users.rb
+++ b/db/migrate/20131019133109_devise_create_users.rb
@@ -1,4 +1,4 @@
-class DeviseCreateUsers < ActiveRecord::Migration
+class DeviseCreateUsers < ActiveRecord::Migration[4.2]
def change
create_table(:users) do |t|
## Database authenticatable
diff --git a/db/migrate/20131019133235_add_columns_to_users.rb b/db/migrate/20131019133235_add_columns_to_users.rb
index 63f1b7f3..60257cc0 100644
--- a/db/migrate/20131019133235_add_columns_to_users.rb
+++ b/db/migrate/20131019133235_add_columns_to_users.rb
@@ -1,4 +1,4 @@
-class AddColumnsToUsers < ActiveRecord::Migration
+class AddColumnsToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :nickname, :string
add_column :users, :name, :string
diff --git a/db/migrate/20131019144930_add_bitcoin_address_to_users.rb b/db/migrate/20131019144930_add_bitcoin_address_to_users.rb
index 0977232b..c22933ab 100644
--- a/db/migrate/20131019144930_add_bitcoin_address_to_users.rb
+++ b/db/migrate/20131019144930_add_bitcoin_address_to_users.rb
@@ -1,4 +1,4 @@
-class AddBitcoinAddressToUsers < ActiveRecord::Migration
+class AddBitcoinAddressToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :bitcoin_address, :string
end
diff --git a/db/migrate/20131019164745_create_projects.rb b/db/migrate/20131019164745_create_projects.rb
index 165a4180..8b682c73 100644
--- a/db/migrate/20131019164745_create_projects.rb
+++ b/db/migrate/20131019164745_create_projects.rb
@@ -1,4 +1,4 @@
-class CreateProjects < ActiveRecord::Migration
+class CreateProjects < ActiveRecord::Migration[4.2]
def change
create_table :projects do |t|
t.string :url
diff --git a/db/migrate/20131019170122_create_deposits.rb b/db/migrate/20131019170122_create_deposits.rb
index 8c483564..45db3a76 100644
--- a/db/migrate/20131019170122_create_deposits.rb
+++ b/db/migrate/20131019170122_create_deposits.rb
@@ -1,4 +1,4 @@
-class CreateDeposits < ActiveRecord::Migration
+class CreateDeposits < ActiveRecord::Migration[4.2]
def change
create_table :deposits do |t|
t.references :project, index: true
diff --git a/db/migrate/20131019170659_create_sendmanies.rb b/db/migrate/20131019170659_create_sendmanies.rb
index b3f9ddb8..cd13b386 100644
--- a/db/migrate/20131019170659_create_sendmanies.rb
+++ b/db/migrate/20131019170659_create_sendmanies.rb
@@ -1,4 +1,4 @@
-class CreateSendmanies < ActiveRecord::Migration
+class CreateSendmanies < ActiveRecord::Migration[4.2]
def change
create_table :sendmanies do |t|
t.string :txid
diff --git a/db/migrate/20131019170925_create_tips.rb b/db/migrate/20131019170925_create_tips.rb
index 3dc35405..173ff7fa 100644
--- a/db/migrate/20131019170925_create_tips.rb
+++ b/db/migrate/20131019170925_create_tips.rb
@@ -1,4 +1,4 @@
-class CreateTips < ActiveRecord::Migration
+class CreateTips < ActiveRecord::Migration[4.2]
def change
create_table :tips do |t|
t.references :deposit, index: true
diff --git a/db/migrate/20131019175751_add_some_fields_to_projects.rb b/db/migrate/20131019175751_add_some_fields_to_projects.rb
index f643f300..359ed32c 100644
--- a/db/migrate/20131019175751_add_some_fields_to_projects.rb
+++ b/db/migrate/20131019175751_add_some_fields_to_projects.rb
@@ -1,4 +1,4 @@
-class AddSomeFieldsToProjects < ActiveRecord::Migration
+class AddSomeFieldsToProjects < ActiveRecord::Migration[4.2]
def change
add_column :projects, :name, :string
add_column :projects, :full_name, :string
diff --git a/db/migrate/20131019205025_add_amount_to_deposit.rb b/db/migrate/20131019205025_add_amount_to_deposit.rb
index b34c8bd1..d4be2067 100644
--- a/db/migrate/20131019205025_add_amount_to_deposit.rb
+++ b/db/migrate/20131019205025_add_amount_to_deposit.rb
@@ -1,4 +1,4 @@
-class AddAmountToDeposit < ActiveRecord::Migration
+class AddAmountToDeposit < ActiveRecord::Migration[4.2]
def change
add_column :deposits, :amount, :integer, :limit => 8
end
diff --git a/db/migrate/20131019211518_add_last_commit_to_projects.rb b/db/migrate/20131019211518_add_last_commit_to_projects.rb
index 92078e8a..749be65d 100644
--- a/db/migrate/20131019211518_add_last_commit_to_projects.rb
+++ b/db/migrate/20131019211518_add_last_commit_to_projects.rb
@@ -1,4 +1,4 @@
-class AddLastCommitToProjects < ActiveRecord::Migration
+class AddLastCommitToProjects < ActiveRecord::Migration[4.2]
def change
add_column :projects, :last_commit, :string
end
diff --git a/db/migrate/20131020003746_add_commit_to_tip.rb b/db/migrate/20131020003746_add_commit_to_tip.rb
index 3cd6a56b..78823996 100644
--- a/db/migrate/20131020003746_add_commit_to_tip.rb
+++ b/db/migrate/20131020003746_add_commit_to_tip.rb
@@ -1,4 +1,4 @@
-class AddCommitToTip < ActiveRecord::Migration
+class AddCommitToTip < ActiveRecord::Migration[4.2]
def change
add_column :tips, :commit, :string
end
diff --git a/db/migrate/20131020120722_add_login_token_to_users.rb b/db/migrate/20131020120722_add_login_token_to_users.rb
index 82ba6d74..e3ee6076 100644
--- a/db/migrate/20131020120722_add_login_token_to_users.rb
+++ b/db/migrate/20131020120722_add_login_token_to_users.rb
@@ -1,4 +1,4 @@
-class AddLoginTokenToUsers < ActiveRecord::Migration
+class AddLoginTokenToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :login_token, :string
end
diff --git a/db/migrate/20131020143021_add_unsubscribed_to_users.rb b/db/migrate/20131020143021_add_unsubscribed_to_users.rb
index a6b587d1..fbc4b620 100644
--- a/db/migrate/20131020143021_add_unsubscribed_to_users.rb
+++ b/db/migrate/20131020143021_add_unsubscribed_to_users.rb
@@ -1,4 +1,4 @@
-class AddUnsubscribedToUsers < ActiveRecord::Migration
+class AddUnsubscribedToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :unsubscribed, :boolean
end
diff --git a/db/migrate/20131020145043_add_notified_at_to_users.rb b/db/migrate/20131020145043_add_notified_at_to_users.rb
index 8561e278..0a20a915 100644
--- a/db/migrate/20131020145043_add_notified_at_to_users.rb
+++ b/db/migrate/20131020145043_add_notified_at_to_users.rb
@@ -1,4 +1,4 @@
-class AddNotifiedAtToUsers < ActiveRecord::Migration
+class AddNotifiedAtToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :notified_at, :datetime
end
diff --git a/db/migrate/20131030142320_add_project_to_tip.rb b/db/migrate/20131030142320_add_project_to_tip.rb
index bf45132c..ff882711 100644
--- a/db/migrate/20131030142320_add_project_to_tip.rb
+++ b/db/migrate/20131030142320_add_project_to_tip.rb
@@ -1,4 +1,4 @@
-class AddProjectToTip < ActiveRecord::Migration
+class AddProjectToTip < ActiveRecord::Migration[4.2]
def change
add_reference :tips, :project, index: true
end
diff --git a/db/migrate/20131030142749_drop_deposit_from_tip.rb b/db/migrate/20131030142749_drop_deposit_from_tip.rb
index 1c1ddff8..3db72501 100644
--- a/db/migrate/20131030142749_drop_deposit_from_tip.rb
+++ b/db/migrate/20131030142749_drop_deposit_from_tip.rb
@@ -1,4 +1,4 @@
-class DropDepositFromTip < ActiveRecord::Migration
+class DropDepositFromTip < ActiveRecord::Migration[4.2]
def change
remove_column :tips, :deposit_id
end
diff --git a/db/migrate/20131030191346_add_available_amount_cache_to_projects.rb b/db/migrate/20131030191346_add_available_amount_cache_to_projects.rb
index 28260bf5..4ea2248c 100644
--- a/db/migrate/20131030191346_add_available_amount_cache_to_projects.rb
+++ b/db/migrate/20131030191346_add_available_amount_cache_to_projects.rb
@@ -1,4 +1,4 @@
-class AddAvailableAmountCacheToProjects < ActiveRecord::Migration
+class AddAvailableAmountCacheToProjects < ActiveRecord::Migration[4.2]
def change
add_column :projects, :available_amount_cache, :integer
end
diff --git a/db/migrate/20131212190037_add_cache_to_users.rb b/db/migrate/20131212190037_add_cache_to_users.rb
index 0be8ddf8..05b0f2e7 100644
--- a/db/migrate/20131212190037_add_cache_to_users.rb
+++ b/db/migrate/20131212190037_add_cache_to_users.rb
@@ -1,4 +1,4 @@
-class AddCacheToUsers < ActiveRecord::Migration
+class AddCacheToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :commits_count, :integer, default: 0
add_column :users, :withdrawn_amount, :integer, limit: 8, default: 0
diff --git a/db/migrate/20140102095035_add_refunded_at_to_tips.rb b/db/migrate/20140102095035_add_refunded_at_to_tips.rb
index 14d98acf..1d2a01e8 100644
--- a/db/migrate/20140102095035_add_refunded_at_to_tips.rb
+++ b/db/migrate/20140102095035_add_refunded_at_to_tips.rb
@@ -1,4 +1,4 @@
-class AddRefundedAtToTips < ActiveRecord::Migration
+class AddRefundedAtToTips < ActiveRecord::Migration[4.2]
def change
add_column :tips, :refunded_at, :timestamp
remove_column :tips, :is_refunded, :boolean
diff --git a/db/migrate/20140207061855_add_github_id_to_projects.rb b/db/migrate/20140207061855_add_github_id_to_projects.rb
index 9f2e8f24..8603e22f 100644
--- a/db/migrate/20140207061855_add_github_id_to_projects.rb
+++ b/db/migrate/20140207061855_add_github_id_to_projects.rb
@@ -1,4 +1,4 @@
-class AddGithubIdToProjects < ActiveRecord::Migration
+class AddGithubIdToProjects < ActiveRecord::Migration[4.2]
def change
add_column :projects, :github_id, :string
end
diff --git a/db/migrate/20140209022632_change_projects_description.rb b/db/migrate/20140209022632_change_projects_description.rb
index a02592e2..dd04c317 100644
--- a/db/migrate/20140209022632_change_projects_description.rb
+++ b/db/migrate/20140209022632_change_projects_description.rb
@@ -1,4 +1,4 @@
-class ChangeProjectsDescription < ActiveRecord::Migration
+class ChangeProjectsDescription < ActiveRecord::Migration[4.2]
def up
change_column :projects, :description, :text, :limit => nil
end
diff --git a/db/migrate/20140209041123_create_indexes_for_projects.rb b/db/migrate/20140209041123_create_indexes_for_projects.rb
index 30f06922..c17aa464 100644
--- a/db/migrate/20140209041123_create_indexes_for_projects.rb
+++ b/db/migrate/20140209041123_create_indexes_for_projects.rb
@@ -1,4 +1,4 @@
-class CreateIndexesForProjects < ActiveRecord::Migration
+class CreateIndexesForProjects < ActiveRecord::Migration[4.2]
def change
add_index :projects, :full_name, :unique => true
add_index :projects, :github_id, :unique => true
diff --git a/db/migrate/20140223061035_add_project_host.rb b/db/migrate/20140223061035_add_project_host.rb
index ee2a5825..93def914 100644
--- a/db/migrate/20140223061035_add_project_host.rb
+++ b/db/migrate/20140223061035_add_project_host.rb
@@ -1,4 +1,4 @@
-class AddProjectHost < ActiveRecord::Migration
+class AddProjectHost < ActiveRecord::Migration[4.2]
class Project < ActiveRecord::Base
end
diff --git a/db/migrate/20140309192616_create_collaborators.rb b/db/migrate/20140309192616_create_collaborators.rb
index c0d734dc..2aa5ced4 100644
--- a/db/migrate/20140309192616_create_collaborators.rb
+++ b/db/migrate/20140309192616_create_collaborators.rb
@@ -1,4 +1,4 @@
-class CreateCollaborators < ActiveRecord::Migration
+class CreateCollaborators < ActiveRecord::Migration[4.2]
def change
create_table :collaborators do |t|
t.belongs_to :project, index: true
diff --git a/db/migrate/20140323072851_add_hold_tips_to_project.rb b/db/migrate/20140323072851_add_hold_tips_to_project.rb
index bb932ba1..97063382 100644
--- a/db/migrate/20140323072851_add_hold_tips_to_project.rb
+++ b/db/migrate/20140323072851_add_hold_tips_to_project.rb
@@ -1,4 +1,4 @@
-class AddHoldTipsToProject < ActiveRecord::Migration
+class AddHoldTipsToProject < ActiveRecord::Migration[4.2]
def change
add_column :projects, :hold_tips, :boolean, default: false
end
diff --git a/db/migrate/20140323165816_add_commit_message_to_tip.rb b/db/migrate/20140323165816_add_commit_message_to_tip.rb
index aad73bee..50bc133b 100644
--- a/db/migrate/20140323165816_add_commit_message_to_tip.rb
+++ b/db/migrate/20140323165816_add_commit_message_to_tip.rb
@@ -1,4 +1,4 @@
-class AddCommitMessageToTip < ActiveRecord::Migration
+class AddCommitMessageToTip < ActiveRecord::Migration[4.2]
def change
add_column :tips, :commit_message, :string
end
diff --git a/db/migrate/20140323173320_create_tipping_policies_texts.rb b/db/migrate/20140323173320_create_tipping_policies_texts.rb
index 898e3428..1d62f4d1 100644
--- a/db/migrate/20140323173320_create_tipping_policies_texts.rb
+++ b/db/migrate/20140323173320_create_tipping_policies_texts.rb
@@ -1,4 +1,4 @@
-class CreateTippingPoliciesTexts < ActiveRecord::Migration
+class CreateTippingPoliciesTexts < ActiveRecord::Migration[4.2]
def change
create_table :tipping_policies_texts do |t|
t.belongs_to :project, index: true
diff --git a/db/migrate/20140402032836_change_commit_message_type.rb b/db/migrate/20140402032836_change_commit_message_type.rb
index 48467d77..9fa48dd3 100644
--- a/db/migrate/20140402032836_change_commit_message_type.rb
+++ b/db/migrate/20140402032836_change_commit_message_type.rb
@@ -1,4 +1,4 @@
-class ChangeCommitMessageType < ActiveRecord::Migration
+class ChangeCommitMessageType < ActiveRecord::Migration[4.2]
def up
change_column :tips, :commit_message, :text
end
diff --git a/db/migrate/20140402034521_change_commit_message_limit.rb b/db/migrate/20140402034521_change_commit_message_limit.rb
index 34aca125..61eb8255 100644
--- a/db/migrate/20140402034521_change_commit_message_limit.rb
+++ b/db/migrate/20140402034521_change_commit_message_limit.rb
@@ -1,4 +1,4 @@
-class ChangeCommitMessageLimit < ActiveRecord::Migration
+class ChangeCommitMessageLimit < ActiveRecord::Migration[4.2]
def up
change_column :tips, :commit_message, :text, limit: nil
end
diff --git a/db/migrate/20140402082149_add_fee_size_to_deposits.rb b/db/migrate/20140402082149_add_fee_size_to_deposits.rb
index 5f3c96a1..e137e515 100644
--- a/db/migrate/20140402082149_add_fee_size_to_deposits.rb
+++ b/db/migrate/20140402082149_add_fee_size_to_deposits.rb
@@ -1,4 +1,4 @@
-class AddFeeSizeToDeposits < ActiveRecord::Migration
+class AddFeeSizeToDeposits < ActiveRecord::Migration[4.2]
class Deposit < ActiveRecord::Base
end
diff --git a/db/migrate/20140620123610_add_decided_at_to_tips.rb b/db/migrate/20140620123610_add_decided_at_to_tips.rb
index c9ae29ed..4ae6c112 100644
--- a/db/migrate/20140620123610_add_decided_at_to_tips.rb
+++ b/db/migrate/20140620123610_add_decided_at_to_tips.rb
@@ -1,4 +1,4 @@
-class AddDecidedAtToTips < ActiveRecord::Migration
+class AddDecidedAtToTips < ActiveRecord::Migration[4.2]
def change
add_column :tips, :decided_at, :timestamp
end
diff --git a/db/migrate/20140620124628_update_decided_at_for_existing_tips.rb b/db/migrate/20140620124628_update_decided_at_for_existing_tips.rb
index 17ab997f..974d368a 100644
--- a/db/migrate/20140620124628_update_decided_at_for_existing_tips.rb
+++ b/db/migrate/20140620124628_update_decided_at_for_existing_tips.rb
@@ -1,4 +1,4 @@
-class UpdateDecidedAtForExistingTips < ActiveRecord::Migration
+class UpdateDecidedAtForExistingTips < ActiveRecord::Migration[4.2]
def up
Tip.where.not(amount: nil).find_each do |tip|
tip.update decided_at: tip.created_at
diff --git a/db/migrate/20140717085945_add_info_updated_at_to_projects.rb b/db/migrate/20140717085945_add_info_updated_at_to_projects.rb
index 7b5d77af..2da405bb 100644
--- a/db/migrate/20140717085945_add_info_updated_at_to_projects.rb
+++ b/db/migrate/20140717085945_add_info_updated_at_to_projects.rb
@@ -1,4 +1,4 @@
-class AddInfoUpdatedAtToProjects < ActiveRecord::Migration
+class AddInfoUpdatedAtToProjects < ActiveRecord::Migration[4.2]
def change
add_column :projects, :info_updated_at, :timestamp
end
diff --git a/db/migrate/20140722092532_add_confirmation_fields_to_users.rb b/db/migrate/20140722092532_add_confirmation_fields_to_users.rb
index dab00bd0..c21b8c36 100644
--- a/db/migrate/20140722092532_add_confirmation_fields_to_users.rb
+++ b/db/migrate/20140722092532_add_confirmation_fields_to_users.rb
@@ -1,4 +1,4 @@
-class AddConfirmationFieldsToUsers < ActiveRecord::Migration
+class AddConfirmationFieldsToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :confirmed_at, :timestamp
add_column :users, :confirmation_sent_at, :timestamp
diff --git a/db/migrate/20140725054216_add_display_name_to_users.rb b/db/migrate/20140725054216_add_display_name_to_users.rb
index 9e783036..6db1c1c1 100644
--- a/db/migrate/20140725054216_add_display_name_to_users.rb
+++ b/db/migrate/20140725054216_add_display_name_to_users.rb
@@ -1,4 +1,4 @@
-class AddDisplayNameToUsers < ActiveRecord::Migration
+class AddDisplayNameToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :display_name, :string
end
diff --git a/db/migrate/20140816062159_remove_paid_out_from_deposits.rb b/db/migrate/20140816062159_remove_paid_out_from_deposits.rb
index b7726e56..409b4c5e 100644
--- a/db/migrate/20140816062159_remove_paid_out_from_deposits.rb
+++ b/db/migrate/20140816062159_remove_paid_out_from_deposits.rb
@@ -1,4 +1,4 @@
-class RemovePaidOutFromDeposits < ActiveRecord::Migration
+class RemovePaidOutFromDeposits < ActiveRecord::Migration[4.2]
def change
remove_column :deposits, :paid_out, :integer, :limit => 8
remove_column :deposits, :paid_out_at, :datetime
diff --git a/db/migrate/20140823035950_add_branch_to_projects.rb b/db/migrate/20140823035950_add_branch_to_projects.rb
index d514601c..fcc62eda 100644
--- a/db/migrate/20140823035950_add_branch_to_projects.rb
+++ b/db/migrate/20140823035950_add_branch_to_projects.rb
@@ -1,4 +1,4 @@
-class AddBranchToProjects < ActiveRecord::Migration
+class AddBranchToProjects < ActiveRecord::Migration[4.2]
def change
add_column :projects, :branch, :string, default: 'master'
end
diff --git a/db/migrate/20140823060921_make_default_branch_blank.rb b/db/migrate/20140823060921_make_default_branch_blank.rb
index b191d00b..e0bee36f 100644
--- a/db/migrate/20140823060921_make_default_branch_blank.rb
+++ b/db/migrate/20140823060921_make_default_branch_blank.rb
@@ -1,4 +1,4 @@
-class MakeDefaultBranchBlank < ActiveRecord::Migration
+class MakeDefaultBranchBlank < ActiveRecord::Migration[4.2]
def change
change_column :projects, :branch, :string, default: nil
end
diff --git a/db/migrate/20140918051752_add_disable_notifications_to_projects.rb b/db/migrate/20140918051752_add_disable_notifications_to_projects.rb
index 98c03469..9a8b0e34 100644
--- a/db/migrate/20140918051752_add_disable_notifications_to_projects.rb
+++ b/db/migrate/20140918051752_add_disable_notifications_to_projects.rb
@@ -1,4 +1,4 @@
-class AddDisableNotificationsToProjects < ActiveRecord::Migration
+class AddDisableNotificationsToProjects < ActiveRecord::Migration[4.2]
def change
add_column :projects, :disable_notifications, :boolean
end
diff --git a/db/migrate/20141029083726_add_avatar_to_projects.rb b/db/migrate/20141029083726_add_avatar_to_projects.rb
index c4d9f893..d4d07215 100644
--- a/db/migrate/20141029083726_add_avatar_to_projects.rb
+++ b/db/migrate/20141029083726_add_avatar_to_projects.rb
@@ -1,4 +1,4 @@
-class AddAvatarToProjects < ActiveRecord::Migration
+class AddAvatarToProjects < ActiveRecord::Migration[4.2]
def change
add_column :projects, :avatar_url, :string
end
diff --git a/db/migrate/20141112064004_add_deleted_at_to_projects.rb b/db/migrate/20141112064004_add_deleted_at_to_projects.rb
index 032050f9..d930003d 100644
--- a/db/migrate/20141112064004_add_deleted_at_to_projects.rb
+++ b/db/migrate/20141112064004_add_deleted_at_to_projects.rb
@@ -1,4 +1,4 @@
-class AddDeletedAtToProjects < ActiveRecord::Migration
+class AddDeletedAtToProjects < ActiveRecord::Migration[4.2]
def change
add_column :projects, :deleted_at, :timestamp
end
diff --git a/db/migrate/20150620054216_add_denom.rb b/db/migrate/20150620054216_add_denom.rb
index 91cde8be..6687c650 100755
--- a/db/migrate/20150620054216_add_denom.rb
+++ b/db/migrate/20150620054216_add_denom.rb
@@ -1,4 +1,4 @@
-class AddDenom < ActiveRecord::Migration
+class AddDenom < ActiveRecord::Migration[4.2]
def change
add_column :users, :denom, :integer, default: 0
end
diff --git a/db/migrate/20151219081507_add_bitcoin_address2_to_projects.rb b/db/migrate/20151219081507_add_bitcoin_address2_to_projects.rb
index 8ade9884..e9d6bd19 100644
--- a/db/migrate/20151219081507_add_bitcoin_address2_to_projects.rb
+++ b/db/migrate/20151219081507_add_bitcoin_address2_to_projects.rb
@@ -1,4 +1,4 @@
-class AddBitcoinAddress2ToProjects < ActiveRecord::Migration
+class AddBitcoinAddress2ToProjects < ActiveRecord::Migration[4.2]
def change
add_column :projects, :bitcoin_address2, :string, index: true
reversible do |dir|
diff --git a/db/migrate/20170308152313_create_wallets.rb b/db/migrate/20170308152313_create_wallets.rb
index 9f349ec3..053ede27 100644
--- a/db/migrate/20170308152313_create_wallets.rb
+++ b/db/migrate/20170308152313_create_wallets.rb
@@ -1,4 +1,4 @@
-class CreateWallets < ActiveRecord::Migration
+class CreateWallets < ActiveRecord::Migration[4.2]
def change
create_table :wallets do |t|
t.string :name
diff --git a/db/migrate/20170308161814_add_wallet_id_to_projects.rb b/db/migrate/20170308161814_add_wallet_id_to_projects.rb
index 8e3f71dc..1de39ebc 100644
--- a/db/migrate/20170308161814_add_wallet_id_to_projects.rb
+++ b/db/migrate/20170308161814_add_wallet_id_to_projects.rb
@@ -1,4 +1,4 @@
-class AddWalletIdToProjects < ActiveRecord::Migration
+class AddWalletIdToProjects < ActiveRecord::Migration[4.2]
def change
add_column :projects, :wallet_id, :integer
end
diff --git a/db/migrate/20170308163825_add_legacy_addresses_to_projects.rb b/db/migrate/20170308163825_add_legacy_addresses_to_projects.rb
index 008f11b9..98ed4509 100644
--- a/db/migrate/20170308163825_add_legacy_addresses_to_projects.rb
+++ b/db/migrate/20170308163825_add_legacy_addresses_to_projects.rb
@@ -1,4 +1,4 @@
-class AddLegacyAddressesToProjects < ActiveRecord::Migration
+class AddLegacyAddressesToProjects < ActiveRecord::Migration[4.2]
def change
add_column :projects, :legacy_address, :string
end
From 9858f80bc1e548f4e5c68353efef0cf4aa297dde Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sat, 21 Nov 2020 10:17:55 +0100
Subject: [PATCH 065/159] Added images to the manifest
---
app/assets/config/manifest.js | 4 +++-
config/environments/development.rb | 2 --
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js
index 670e8d0e..025c00ea 100644
--- a/app/assets/config/manifest.js
+++ b/app/assets/config/manifest.js
@@ -2,4 +2,6 @@
//
//= link application.css
//
-//= link application.js
\ No newline at end of file
+//= link application.js
+//
+//= link_tree ../images
diff --git a/config/environments/development.rb b/config/environments/development.rb
index 3e5e8255..42389197 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -28,6 +28,4 @@
# This option may cause significant delays in view rendering with a large
# number of complex assets.
config.assets.debug = true
-
- config.assets.check_precompiled_asset = false
end
From 65bfdc177f796fe1a16b2882103225b86cd450be Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sat, 21 Nov 2020 10:18:27 +0100
Subject: [PATCH 066/159] Update capistrano
---
Capfile | 3 +++
Gemfile | 13 +++++++------
Gemfile.lock | 30 +++++++++++++++++-------------
config/deploy.rb | 1 -
4 files changed, 27 insertions(+), 20 deletions(-)
diff --git a/Capfile b/Capfile
index 3a9dac77..3438e6b5 100644
--- a/Capfile
+++ b/Capfile
@@ -22,5 +22,8 @@ require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
+require "capistrano/scm/git"
+install_plugin Capistrano::SCM::Git
+
# Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }
diff --git a/Gemfile b/Gemfile
index 054cfe5c..9043e5ad 100644
--- a/Gemfile
+++ b/Gemfile
@@ -43,14 +43,15 @@ gem 'twitter-bootstrap-rails'
gem 'uglifier'
group :development do
- gem 'capistrano', '~> 3.4.0'
- gem 'capistrano-bundler', '~> 1.1.2'
- gem 'capistrano-rails', '~> 1.1.0'
- gem 'capistrano-rvm', '~> 0.1.0'
+ gem 'capistrano'
+ gem 'capistrano-bundler'
+ gem 'capistrano-rails'
+ gem 'capistrano-rvm'
# add ed25519 support to net-ssh
- gem 'bcrypt_pbkdf', '~> 1.0.0'
- gem 'rbnacl', '< 5'
+ gem 'bcrypt_pbkdf'
+ gem 'ed25519'
+ gem 'rbnacl'
end
group :development, :test do
diff --git a/Gemfile.lock b/Gemfile.lock
index c72ff6a5..0ef7dc70 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -51,6 +51,8 @@ GEM
airbrake-ruby (~> 5.1)
airbrake-ruby (5.1.1)
rbtree3 (~> 0.5)
+ airbrussh (1.4.0)
+ sshkit (>= 1.6.1, != 1.7.0)
arel (9.0.0)
backports (3.18.2)
bcrypt (3.1.16)
@@ -61,16 +63,16 @@ GEM
activemodel (>= 5.2)
builder (3.2.4)
cancancan (3.1.0)
- capistrano (3.4.1)
+ capistrano (3.14.1)
+ airbrussh (>= 1.0.0)
i18n
rake (>= 10.0.0)
- sshkit (~> 1.3)
- capistrano-bundler (1.1.4)
+ sshkit (>= 1.9.0)
+ capistrano-bundler (2.0.1)
capistrano (~> 3.1)
- sshkit (~> 1.2)
- capistrano-rails (1.1.8)
+ capistrano-rails (1.6.1)
capistrano (~> 3.1)
- capistrano-bundler (~> 1.1)
+ capistrano-bundler (>= 1.1, < 3)
capistrano-rvm (0.1.2)
capistrano (~> 3.0)
sshkit (~> 1.2)
@@ -134,6 +136,7 @@ GEM
activerecord (>= 3.0)
edge_rider (>= 0.2.5)
easy_gravatar (1.0.1)
+ ed25519 (1.2.4)
edge_rider (1.1.0)
activerecord (>= 3.2)
erubi (1.10.0)
@@ -291,7 +294,7 @@ GEM
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
rake (13.0.1)
- rbnacl (4.0.2)
+ rbnacl (7.1.1)
ffi
rbtree3 (0.6.0)
rdoc (6.2.1)
@@ -411,14 +414,14 @@ DEPENDENCIES
acts_as_paranoid
airbrake
bcrypt
- bcrypt_pbkdf (~> 1.0.0)
+ bcrypt_pbkdf
bech32
bootstrap_form
cancancan
- capistrano (~> 3.4.0)
- capistrano-bundler (~> 1.1.2)
- capistrano-rails (~> 1.1.0)
- capistrano-rvm (~> 0.1.0)
+ capistrano
+ capistrano-bundler
+ capistrano-rails
+ capistrano-rvm
coffee-rails
cucumber-rails (~> 1.0)
database_cleaner
@@ -427,6 +430,7 @@ DEPENDENCIES
devise-i18n
dusen
easy_gravatar
+ ed25519
factory_bot_rails
haml-rails
http_accept_language
@@ -444,7 +448,7 @@ DEPENDENCIES
rails (= 5.2.4.4)
rails-controller-testing
rails-i18n
- rbnacl (< 5)
+ rbnacl
render_csv
rest-client
rspec-activemodel-mocks
diff --git a/config/deploy.rb b/config/deploy.rb
index 932e2754..bfc89d0d 100644
--- a/config/deploy.rb
+++ b/config/deploy.rb
@@ -4,7 +4,6 @@
# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }
set :deploy_to, '/home/apps/t4c'
-set :scm, :git
set :rvm_type, :user
set :rvm_ruby_version, '2.5.8'
From 4fe8804b07ca41a7bc1bc9164e3629384db35b13 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 22 Nov 2020 10:35:22 +0100
Subject: [PATCH 067/159] Chore/rubocop (#400)
added rubocop and fixed some warnings
---
.gitignore | 4 +-
.rubocop.yml | 11 +
.rubocop_todo.yml | 183 +++++++++++++++
.travis.yml | 1 +
Capfile | 4 +-
Gemfile | 5 +-
Gemfile.lock | 20 ++
Rakefile | 4 +-
app/controllers/application_controller.rb | 64 +++--
app/controllers/deposits_controller.rb | 20 +-
app/controllers/home_controller.rb | 2 +
app/controllers/projects_controller.rb | 30 +--
app/controllers/tips_controller.rb | 10 +-
.../users/omniauth_callbacks_controller.rb | 48 ++--
app/controllers/users_controller.rb | 8 +-
app/controllers/withdrawals_controller.rb | 4 +-
app/helpers/application_helper.rb | 12 +-
app/helpers/deposits_helper.rb | 2 +
app/helpers/home_helper.rb | 2 +
app/helpers/projects_helper.rb | 23 +-
app/helpers/sessions_helper.rb | 2 +
app/helpers/users_helper.rb | 2 +
app/mailers/user_mailer.rb | 10 +-
app/models/ability.rb | 8 +-
app/models/application_record.rb | 4 +-
app/models/collaborator.rb | 2 +
app/models/deposit.rb | 5 +-
app/models/project.rb | 119 +++++-----
app/models/sendmany.rb | 12 +-
app/models/tip.rb | 71 +++---
app/models/tipping_policies_text.rb | 2 +
app/models/user.rb | 24 +-
app/models/wallet.rb | 3 +-
app/services/bitbucket.rb | 38 +--
app/services/github.rb | 59 +++--
bin/airbrake | 16 --
bin/bundle | 3 -
bin/bundler | 16 --
bin/cap | 16 --
bin/cdiff | 16 --
bin/colortab | 16 --
bin/decolor | 16 --
bin/erubis | 16 --
bin/haml | 16 --
bin/lessc | 16 --
bin/rackup | 16 --
bin/rails | 4 -
bin/rake | 4 -
bin/rdoc | 16 --
bin/ri | 16 --
bin/sass | 16 --
bin/sass-convert | 16 --
bin/scss | 16 --
bin/sdoc | 16 --
bin/sdoc-merge | 16 --
bin/slimrb | 16 --
bin/sprockets | 16 --
bin/term_display | 16 --
bin/term_mandel | 16 --
bin/thor | 16 --
bin/tilt | 16 --
bin/tt | 16 --
config.ru | 4 +-
config/application.rb | 4 +-
config/boot.rb | 6 +-
config/deploy.rb | 2 +
config/deploy/production.rb | 10 +-
config/deploy/staging.rb | 10 +-
config/environment.rb | 4 +-
config/environments/development.rb | 4 +-
config/environments/production.rb | 6 +-
config/environments/test.rb | 8 +-
config/initializers/backtrace_silencers.rb | 1 +
config/initializers/blacklist.rb | 4 +-
config/initializers/demoji.rb | 4 +-
config/initializers/devise.rb | 8 +-
config/initializers/errbit.rb | 8 +-
.../initializers/filter_parameter_logging.rb | 2 +
config/initializers/inflections.rb | 1 +
config/initializers/mime_types.rb | 4 +-
config/initializers/secret_token.rb | 2 +
config/initializers/session_store.rb | 2 +
config/initializers/wrap_parameters.rb | 2 +
config/routes.rb | 39 +--
.../20131019133109_devise_create_users.rb | 13 +-
.../20131019133235_add_columns_to_users.rb | 2 +
...1019144930_add_bitcoin_address_to_users.rb | 2 +
db/migrate/20131019164745_create_projects.rb | 2 +
db/migrate/20131019170122_create_deposits.rb | 6 +-
.../20131019170659_create_sendmanies.rb | 2 +
db/migrate/20131019170925_create_tips.rb | 4 +-
...31019175751_add_some_fields_to_projects.rb | 2 +
.../20131019205025_add_amount_to_deposit.rb | 4 +-
...31019211518_add_last_commit_to_projects.rb | 2 +
.../20131020003746_add_commit_to_tip.rb | 2 +
...20131020120722_add_login_token_to_users.rb | 2 +
...0131020143021_add_unsubscribed_to_users.rb | 2 +
...20131020145043_add_notified_at_to_users.rb | 2 +
.../20131030142320_add_project_to_tip.rb | 2 +
.../20131030142749_drop_deposit_from_tip.rb | 2 +
..._add_available_amount_cache_to_projects.rb | 2 +
.../20131212190037_add_cache_to_users.rb | 2 +
.../20140102095035_add_refunded_at_to_tips.rb | 2 +
...0140207061855_add_github_id_to_projects.rb | 2 +
...40209022632_change_projects_description.rb | 5 +-
...40209041123_create_indexes_for_projects.rb | 6 +-
db/migrate/20140223061035_add_project_host.rb | 2 +
.../20140309192616_create_collaborators.rb | 2 +
...20140323072851_add_hold_tips_to_project.rb | 2 +
...0140323165816_add_commit_message_to_tip.rb | 2 +
...323173320_create_tipping_policies_texts.rb | 2 +
...140402032836_change_commit_message_type.rb | 3 +
...40402034521_change_commit_message_limit.rb | 3 +
...20140402082149_add_fee_size_to_deposits.rb | 4 +-
.../20140620123610_add_decided_at_to_tips.rb | 4 +-
...628_update_decided_at_for_existing_tips.rb | 2 +
...7085945_add_info_updated_at_to_projects.rb | 2 +
...092532_add_confirmation_fields_to_users.rb | 2 +
...0140725054216_add_display_name_to_users.rb | 2 +
...816062159_remove_paid_out_from_deposits.rb | 4 +-
.../20140823035950_add_branch_to_projects.rb | 2 +
...0140823060921_make_default_branch_blank.rb | 2 +
...2_add_disable_notifications_to_projects.rb | 2 +
.../20141029083726_add_avatar_to_projects.rb | 2 +
...141112064004_add_deleted_at_to_projects.rb | 2 +
db/migrate/20150620054216_add_denom.rb | 2 +
...081507_add_bitcoin_address2_to_projects.rb | 6 +-
db/migrate/20170308152313_create_wallets.rb | 2 +
...0170308161814_add_wallet_id_to_projects.rb | 2 +
...163825_add_legacy_addresses_to_projects.rb | 2 +
db/schema.rb | 222 +++++++++---------
db/seeds.rb | 1 +
features/step_definitions/common.rb | 116 ++++-----
features/step_definitions/home_steps.rb | 5 +-
features/step_definitions/project_steps.rb | 62 ++---
features/step_definitions/tips_steps.rb | 89 +++----
features/step_definitions/users_steps.rb | 7 +-
features/support/big_decimal_inspect.rb | 2 +
features/support/env.rb | 2 +
features/support/factory_bot.rb | 2 +
features/support/finders.rb | 8 +-
features/support/ostruct_slice.rb | 2 +
features/support/rspec_doubles.rb | 2 +
features/support/to_ostruct.rb | 4 +-
features/support/vcr_setup.rb | 2 +
lib/bitcoin_address_validator.rb | 20 +-
lib/bitcoin_rpc.rb | 20 +-
lib/bitcoin_tipper.rb | 5 +-
lib/blacklist.rb | 23 +-
lib/tasks/cucumber.rake | 89 +++----
script/cucumber | 1 +
spec/controllers/deposits_controller_spec.rb | 15 +-
spec/controllers/home_controller_spec.rb | 44 ++--
spec/controllers/projects_controller_spec.rb | 217 +++++++++--------
spec/controllers/tips_controller_spec.rb | 15 +-
spec/controllers/users_controller_spec.rb | 80 ++++---
.../withdrawals_controller_spec.rb | 15 +-
spec/factories/deposit.rb | 2 +
spec/factories/project.rb | 2 +
spec/factories/sendmany.rb | 2 +
spec/factories/tip.rb | 2 +
spec/factories/user.rb | 2 +
spec/factories/wallets.rb | 2 +
spec/lib/blacklist_spec.rb | 28 ++-
spec/mailers/user_mailer_spec.rb | 2 +
spec/misc_spec.rb | 4 +-
spec/models/collaborator_spec.rb | 2 +
spec/models/deposit_spec.rb | 9 +-
spec/models/project_spec.rb | 4 +-
spec/models/send_many_spec.rb | 2 +
spec/models/sendmany_spec.rb | 2 +
spec/models/tip_spec.rb | 2 +
spec/models/tipping_policies_text_spec.rb | 2 +
spec/models/user_spec.rb | 2 +
spec/models/wallet_spec.rb | 2 +
spec/spec_helper.rb | 12 +-
spec/support/controller_macros.rb | 2 +
177 files changed, 1396 insertions(+), 1239 deletions(-)
create mode 100644 .rubocop.yml
create mode 100644 .rubocop_todo.yml
delete mode 100755 bin/airbrake
delete mode 100755 bin/bundle
delete mode 100755 bin/bundler
delete mode 100755 bin/cap
delete mode 100755 bin/cdiff
delete mode 100755 bin/colortab
delete mode 100755 bin/decolor
delete mode 100755 bin/erubis
delete mode 100755 bin/haml
delete mode 100755 bin/lessc
delete mode 100755 bin/rackup
delete mode 100755 bin/rails
delete mode 100755 bin/rake
delete mode 100755 bin/rdoc
delete mode 100755 bin/ri
delete mode 100755 bin/sass
delete mode 100755 bin/sass-convert
delete mode 100755 bin/scss
delete mode 100755 bin/sdoc
delete mode 100755 bin/sdoc-merge
delete mode 100755 bin/slimrb
delete mode 100755 bin/sprockets
delete mode 100755 bin/term_display
delete mode 100755 bin/term_mandel
delete mode 100755 bin/thor
delete mode 100755 bin/tilt
delete mode 100755 bin/tt
diff --git a/.gitignore b/.gitignore
index f345a12c..3f791f64 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,4 +24,6 @@
coverage
-/db/seeds.rb
\ No newline at end of file
+/db/seeds.rb
+
+/.vscode/
diff --git a/.rubocop.yml b/.rubocop.yml
new file mode 100644
index 00000000..df9ea17d
--- /dev/null
+++ b/.rubocop.yml
@@ -0,0 +1,11 @@
+
+inherit_from: .rubocop_todo.yml
+
+AllCops:
+ TargetRubyVersion: 2.5
+ NewCops: enable
+ Exclude:
+ - 'db/schema.rb'
+
+Style/Documentation:
+ Enabled: false
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
new file mode 100644
index 00000000..89ff7e02
--- /dev/null
+++ b/.rubocop_todo.yml
@@ -0,0 +1,183 @@
+# This configuration was generated by
+# `rubocop --auto-gen-config`
+# on 2020-11-22 09:26:39 UTC using RuboCop version 1.3.1.
+# The point is for the user to remove these configuration records
+# one by one as the offenses are removed from the code base.
+# Note that changes in the inspected code, or installation of new
+# versions of RuboCop, may require this file to be generated again.
+
+# Offense count: 3
+# Configuration parameters: AllowSafeAssignment.
+Lint/AssignmentInCondition:
+ Exclude:
+ - 'app/controllers/application_controller.rb'
+ - 'app/controllers/projects_controller.rb'
+ - 'app/services/github.rb'
+
+# Offense count: 1
+# Configuration parameters: AllowComments, AllowEmptyLambdas.
+Lint/EmptyBlock:
+ Exclude:
+ - 'lib/tasks/cucumber.rake'
+
+# Offense count: 1
+Lint/MissingSuper:
+ Exclude:
+ - 'lib/bitcoin_rpc.rb'
+
+# Offense count: 2
+# Configuration parameters: AllowComments.
+Lint/SuppressedException:
+ Exclude:
+ - 'app/controllers/projects_controller.rb'
+ - 'app/controllers/users_controller.rb'
+
+# Offense count: 1
+Lint/UriEscapeUnescape:
+ Exclude:
+ - 'features/step_definitions/common.rb'
+
+# Offense count: 4
+Lint/UselessAssignment:
+ Exclude:
+ - 'app/models/project.rb'
+ - 'app/models/user.rb'
+ - 'features/step_definitions/common.rb'
+
+# Offense count: 20
+# Configuration parameters: IgnoredMethods.
+Metrics/AbcSize:
+ Max: 67
+
+# Offense count: 19
+# Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
+# ExcludedMethods: refine
+Metrics/BlockLength:
+ Max: 224
+
+# Offense count: 2
+# Configuration parameters: CountComments, CountAsOne.
+Metrics/ClassLength:
+ Max: 183
+
+# Offense count: 7
+# Configuration parameters: IgnoredMethods.
+Metrics/CyclomaticComplexity:
+ Max: 29
+
+# Offense count: 25
+# Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
+Metrics/MethodLength:
+ Max: 56
+
+# Offense count: 1
+# Configuration parameters: CountComments, CountAsOne.
+Metrics/ModuleLength:
+ Max: 162
+
+# Offense count: 7
+# Configuration parameters: IgnoredMethods.
+Metrics/PerceivedComplexity:
+ Max: 31
+
+# Offense count: 1
+Naming/AccessorMethodName:
+ Exclude:
+ - 'lib/bitcoin_rpc.rb'
+
+# Offense count: 1
+Naming/ConstantName:
+ Exclude:
+ - 'lib/bitcoin_address_validator.rb'
+
+# Offense count: 1
+# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
+# AllowedNames: at, by, db, id, in, io, ip, of, on, os, pp, to
+Naming/MethodParameterName:
+ Exclude:
+ - 'lib/bitcoin_rpc.rb'
+
+# Offense count: 1
+# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros.
+# NamePrefix: is_, has_, have_
+# ForbiddenPrefixes: is_, has_, have_
+# AllowedMethods: is_a?
+# MethodDefinitionMacros: define_method, define_singleton_method
+Naming/PredicateName:
+ Exclude:
+ - 'spec/**/*'
+ - 'app/models/project.rb'
+
+# Offense count: 3
+# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers.
+# SupportedStyles: snake_case, normalcase, non_integer
+Naming/VariableNumber:
+ Exclude:
+ - 'features/step_definitions/project_steps.rb'
+
+# Offense count: 23
+# Cop supports --auto-correct.
+# Configuration parameters: AllowOnConstant.
+Style/CaseEquality:
+ Exclude:
+ - 'app/helpers/application_helper.rb'
+
+# Offense count: 1
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: format, sprintf, percent
+Style/FormatString:
+ Exclude:
+ - 'app/helpers/projects_helper.rb'
+
+# Offense count: 9
+# Configuration parameters: MinBodyLength.
+Style/GuardClause:
+ Exclude:
+ - 'app/controllers/application_controller.rb'
+ - 'app/controllers/projects_controller.rb'
+ - 'app/controllers/users/omniauth_callbacks_controller.rb'
+ - 'app/controllers/users_controller.rb'
+ - 'app/models/project.rb'
+ - 'app/models/tip.rb'
+
+# Offense count: 1
+# Cop supports --auto-correct.
+Style/IfUnlessModifier:
+ Exclude:
+ - 'app/models/project.rb'
+
+# Offense count: 1
+Style/MissingRespondToMissing:
+ Exclude:
+ - 'lib/bitcoin_rpc.rb'
+
+# Offense count: 3
+# Configuration parameters: AllowedMethods.
+# AllowedMethods: respond_to_missing?
+Style/OptionalBooleanParameter:
+ Exclude:
+ - 'features/step_definitions/project_steps.rb'
+ - 'lib/bitcoin_rpc.rb'
+ - 'lib/bitcoin_tipper.rb'
+
+# Offense count: 1
+# Configuration parameters: AllowModifier.
+Style/SoleNestedConditional:
+ Exclude:
+ - 'app/models/tip.rb'
+
+# Offense count: 1
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle, AllowSafeAssignment.
+# SupportedStyles: require_parentheses, require_no_parentheses, require_parentheses_when_complex
+Style/TernaryParentheses:
+ Exclude:
+ - 'features/step_definitions/home_steps.rb'
+
+# Offense count: 24
+# Cop supports --auto-correct.
+# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
+# URISchemes: http, https
+Layout/LineLength:
+ Max: 238
diff --git a/.travis.yml b/.travis.yml
index 4119a1d6..7529506b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -15,6 +15,7 @@ before_script:
- cp config/database.yml.sample config/database.yml
script:
+ - bundle exec rubocop
- bundle exec rake db:migrate
- bundle exec rake spec
- bundle exec rake cucumber
diff --git a/Capfile b/Capfile
index 3438e6b5..1d4120ce 100644
--- a/Capfile
+++ b/Capfile
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Load DSL and Setup Up Stages
require 'capistrano/setup'
@@ -22,7 +24,7 @@ require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
-require "capistrano/scm/git"
+require 'capistrano/scm/git'
install_plugin Capistrano::SCM::Git
# Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
diff --git a/Gemfile b/Gemfile
index 9043e5ad..ae6cf86f 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
source 'https://rubygems.org'
ruby '2.5.8'
@@ -57,16 +59,17 @@ end
group :development, :test do
gem 'factory_bot_rails'
gem 'rspec-rails'
+ gem 'rubocop'
gem 'sqlite3'
end
group :test do
gem 'cucumber-rails', '~> 1.0', require: false
gem 'database_cleaner'
+ gem 'rails-controller-testing'
gem 'rspec-activemodel-mocks'
gem 'shoulda-matchers'
gem 'simplecov'
gem 'vcr'
gem 'webmock'
- gem 'rails-controller-testing'
end
diff --git a/Gemfile.lock b/Gemfile.lock
index 0ef7dc70..8446f023 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -54,6 +54,7 @@ GEM
airbrussh (1.4.0)
sshkit (>= 1.6.1, != 1.7.0)
arel (9.0.0)
+ ast (2.4.1)
backports (3.18.2)
bcrypt (3.1.16)
bcrypt_pbkdf (1.0.1)
@@ -258,6 +259,9 @@ GEM
oauth2 (~> 1.4)
omniauth (~> 1.9)
orm_adapter (0.5.0)
+ parallel (1.20.0)
+ parser (2.7.2.0)
+ ast (~> 2.4.1)
public_suffix (4.0.6)
rack (2.2.3)
rack-test (1.1.0)
@@ -293,6 +297,7 @@ GEM
method_source
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
+ rainbow (3.0.0)
rake (13.0.1)
rbnacl (7.1.1)
ffi
@@ -311,6 +316,7 @@ GEM
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
+ rexml (3.2.4)
rspec-activemodel-mocks (1.1.0)
activemodel (>= 3.0)
activesupport (>= 3.0)
@@ -332,6 +338,18 @@ GEM
rspec-mocks (~> 3.9)
rspec-support (~> 3.9)
rspec-support (3.10.0)
+ rubocop (1.3.1)
+ parallel (~> 1.10)
+ parser (>= 2.7.1.5)
+ rainbow (>= 2.2.2, < 4.0)
+ regexp_parser (>= 1.8)
+ rexml
+ rubocop-ast (>= 1.1.1)
+ ruby-progressbar (~> 1.7)
+ unicode-display_width (>= 1.4.0, < 2.0)
+ rubocop-ast (1.1.1)
+ parser (>= 2.7.1.5)
+ ruby-progressbar (1.10.1)
ruby2_keywords (0.0.2)
ruby_parser (3.15.0)
sexp_processor (~> 4.9)
@@ -394,6 +412,7 @@ GEM
unf (0.1.4)
unf_ext
unf_ext (0.0.7.7)
+ unicode-display_width (1.7.0)
vcr (6.0.0)
warden (1.2.9)
rack (>= 2.0.9)
@@ -453,6 +472,7 @@ DEPENDENCIES
rest-client
rspec-activemodel-mocks
rspec-rails
+ rubocop
sass-rails
sawyer
sdoc
diff --git a/Rakefile b/Rakefile
index ccbbc5fa..9268d66d 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,6 +1,8 @@
+# frozen_string_literal: true
+
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
-require File.expand_path('../config/application', __FILE__)
+require File.expand_path('config/application', __dir__)
T4c::Application.load_tasks
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index c7b4c9b0..be20945d 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -1,10 +1,12 @@
+# frozen_string_literal: true
+
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
- rescue_from CanCan::AccessDenied do |exception|
- redirect_to root_path, :alert => I18n.t('errors.access_denied')
+ rescue_from CanCan::AccessDenied do |_exception|
+ redirect_to root_path, alert: I18n.t('errors.access_denied')
end
before_action :load_locale
@@ -14,35 +16,45 @@ class ApplicationController < ActionController::Base
def load_locale
if params[:locale] && ::Rails.application.config.available_locales.include?(params[:locale])
I18n.locale = session[:locale] = params[:locale].to_sym
- redirect_to :back rescue true
+ begin
+ redirect_to :back
+ rescue StandardError
+ true
+ end
elsif session[:locale]
I18n.locale = session[:locale]
- elsif l = http_accept_language.compatible_language_from(::Rails.application.config.available_locales).to_sym rescue nil
+ elsif l = language_from_http_accept_language
I18n.locale = session[:locale] = l
end
end
- def load_project params
- return unless (is_via_project = self.is_a? ProjectsController) ||
- (is_via_tips = self.is_a? TipsController ) ||
- (is_via_deposits = self.is_a? DepositsController)
+ def language_from_http_accept_language
+ http_accept_language.compatible_language_from(::Rails.application.config.available_locales).to_sym
+ rescue StandardError
+ nil
+ end
+
+ def load_project(params)
+ return unless (is_via_project = is_a? ProjectsController) ||
+ (is_via_tips = is_a? TipsController) ||
+ (is_via_deposits = is_a? DepositsController)
- is_standard_path = params[:id] .present? && is_via_project
+ is_standard_path = params[:id].present? && is_via_project
is_association_path = params[:project_id].present?
- is_pretty_path = params[:service] .present? && params[:repo].present?
+ is_pretty_path = params[:service].present? && params[:repo].present?
return unless is_standard_path || is_association_path || is_pretty_path
- if (is_standard_path || is_association_path) &&
- (project_id = (is_via_project)? params[:id] : params[:project_id]) &&
- (@project = (Project.where :id => project_id).first)
+ if (is_standard_path || is_association_path) &&
+ (project_id = is_via_project ? params[:id] : params[:project_id]) &&
+ (@project = (Project.where id: project_id).first)
if is_via_tips
- redirect_to project_tips_pretty_path @project.host , @project.full_name
+ redirect_to project_tips_pretty_path @project.host, @project.full_name
elsif is_via_deposits
- redirect_to project_deposits_pretty_path @project.host , @project.full_name
+ redirect_to project_deposits_pretty_path @project.host, @project.full_name
end
elsif is_pretty_path
- @project = Project.where(host: params[:service]).
- where('lower(`full_name`) = ?' , params[:repo].downcase).first
+ @project = Project.where(host: params[:service])
+ .where('lower(`full_name`) = ?', params[:repo].downcase).first
end
if @project.nil?
@@ -51,21 +63,21 @@ def load_project params
end
end
- def load_user params
- return unless (is_via_user = self.is_a? UsersController) ||
- (is_via_tips = self.is_a? TipsController)
+ def load_user(params)
+ return unless (is_via_user = is_a? UsersController) ||
+ (is_via_tips = is_a? TipsController)
- return unless (is_standard_path = params[:id] .present? && is_via_user) ||
- (is_association_path = params[:user_id] .present?) ||
+ return unless (is_standard_path = params[:id].present? && is_via_user) ||
+ (is_association_path = params[:user_id].present?) ||
(is_pretty_path = params[:nickname].present?)
- if (is_standard_path || is_association_path) &&
- (user_id = (is_via_user && params[:id]) ||
+ if (is_standard_path || is_association_path) &&
+ (user_id = (is_via_user && params[:id]) ||
(is_via_tips && params[:user_id])) &&
- (@user = User.where(:id => user_id).first)
+ (@user = User.where(id: user_id).first)
redirect_to user_tips_pretty_path @user.nickname if is_via_tips
elsif is_pretty_path
- @user = User.where('lower(`nickname`) = ?' , params[:nickname].downcase).first
+ @user = User.where('lower(`nickname`) = ?', params[:nickname].downcase).first
end
if @user.nil?
diff --git a/app/controllers/deposits_controller.rb b/app/controllers/deposits_controller.rb
index 39c77758..a8c0db10 100644
--- a/app/controllers/deposits_controller.rb
+++ b/app/controllers/deposits_controller.rb
@@ -1,18 +1,20 @@
+# frozen_string_literal: true
+
class DepositsController < ApplicationController
before_action { load_project params }
def index
- if @project.present?
- @deposits = @project.deposits
- else
- @deposits = Deposit.includes(:project)
- end
- @deposits = @deposits.order(created_at: :desc).
- page(params[:page]).
- per(params[:per_page] || 30)
+ @deposits = if @project.present?
+ @project.deposits
+ else
+ Deposit.includes(:project)
+ end
+ @deposits = @deposits.order(created_at: :desc)
+ .page(params[:page])
+ .per(params[:per_page] || 30)
respond_to do |format|
format.html
- format.csv { render csv: @deposits, except: [:updated_at, :confirmations, :fee_size], add_methods: [:project_name, :fee, :confirmed?] }
+ format.csv { render csv: @deposits, except: %i[updated_at confirmations fee_size], add_methods: %i[project_name fee confirmed?] }
end
end
end
diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb
index 1d8291f3..a175e5fc 100644
--- a/app/controllers/home_controller.rb
+++ b/app/controllers/home_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class HomeController < ApplicationController
def index
respond_to do |format|
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index f4918332..457236e2 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -1,10 +1,12 @@
+# frozen_string_literal: true
+
require 'net/http'
class ProjectsController < ApplicationController
include ProjectsHelper
- before_action :load_project, only: [:show, :edit, :update, :decide_tip_amounts]
- before_action :redirect_to_pretty_url, only: [:show, :edit, :decide_tip_amounts]
+ before_action :load_project, only: %i[show edit update decide_tip_amounts]
+ before_action :redirect_to_pretty_url, only: %i[show edit decide_tip_amounts]
def index
@projects = Project.order(projects_order).page(params[:page]).per(30)
@@ -37,9 +39,7 @@ def edit
def update
authorize! :update, @project
@project.attributes = project_params
- if @project.tipping_policies_text.try(:text_changed?)
- @project.tipping_policies_text.user = current_user
- end
+ @project.tipping_policies_text.user = current_user if @project.tipping_policies_text.try(:text_changed?)
if @project.save
redirect_to project_path(@project), notice: I18n.t('notices.project_updated')
else
@@ -51,13 +51,14 @@ def decide_tip_amounts
authorize! :decide_tip_amounts, @project
if request.patch?
@project.available_amount # preload anything required to get the amount, otherwise it's loaded during the assignation and there are undesirable consequences
- percentages = params[:project][:tips_attributes].values.map{|tip| tip['amount_percentage'].to_f}
+ percentages = params[:project][:tips_attributes].values.map { |tip| tip['amount_percentage'].to_f }
if percentages.sum > 100
redirect_to decide_tip_amounts_project_path(@project), alert: I18n.t('errors.can_assign_more_tips')
return
end
- raise "wrong data" if percentages.min < 0
- @project.attributes = params.require(:project).permit(tips_attributes: [:id, :amount_percentage])
+ raise 'wrong data' if percentages.min.negative?
+
+ @project.attributes = params.require(:project).permit(tips_attributes: %i[id amount_percentage])
if @project.save
message = I18n.t('notices.tips_decided')
if @project.has_undecided_tips?
@@ -69,10 +70,11 @@ def decide_tip_amounts
end
end
-
private
- def load_project ; super params ; end ;
+ def load_project
+ super params
+ end
def project_params
params.require(:project).permit(:branch, :disable_notifications, :hold_tips, tipping_policies_text_attributes: [:text])
@@ -80,10 +82,10 @@ def project_params
def projects_order
{
- 'balance' => {available_amount_cache: :desc, watchers_count: :desc, full_name: :asc},
- 'watchers' => {watchers_count: :desc, available_amount_cache: :desc, full_name: :asc},
- 'repository' => {full_name: :asc, available_amount_cache: :desc, watchers_count: :desc},
- 'description' => {description: :asc, available_amount_cache: :desc, watchers_count: :desc, full_name: :asc}
+ 'balance' => { available_amount_cache: :desc, watchers_count: :desc, full_name: :asc },
+ 'watchers' => { watchers_count: :desc, available_amount_cache: :desc, full_name: :asc },
+ 'repository' => { full_name: :asc, available_amount_cache: :desc, watchers_count: :desc },
+ 'description' => { description: :asc, available_amount_cache: :desc, watchers_count: :desc, full_name: :asc }
}.[](params[:order] || 'balance')
end
diff --git a/app/controllers/tips_controller.rb b/app/controllers/tips_controller.rb
index 4ef657ed..27698d40 100644
--- a/app/controllers/tips_controller.rb
+++ b/app/controllers/tips_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TipsController < ApplicationController
before_action { load_project params }
before_action { load_user params }
@@ -15,12 +17,12 @@ def index
else
@tips = Tip.with_address.includes(:project)
end
- @tips = @tips.order(created_at: :desc).
- page(params[:page]).
- per(params[:per_page] || 30)
+ @tips = @tips.order(created_at: :desc)
+ .page(params[:page])
+ .per(params[:per_page] || 30)
respond_to do |format|
format.html
- format.csv { render csv: @tips, except: [:updated_at, :commit, :commit_message, :refunded_at, :decided_at], add_methods: [:user_name, :project_name, :decided?, :claimed?, :paid?, :refunded?, :txid] }
+ format.csv { render csv: @tips, except: %i[updated_at commit commit_message refunded_at decided_at], add_methods: %i[user_name project_name decided? claimed? paid? refunded? txid] }
end
end
end
diff --git a/app/controllers/users/omniauth_callbacks_controller.rb b/app/controllers/users/omniauth_callbacks_controller.rb
index 22f49a51..fe2ccad5 100644
--- a/app/controllers/users/omniauth_callbacks_controller.rb
+++ b/app/controllers/users/omniauth_callbacks_controller.rb
@@ -1,37 +1,39 @@
-class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
- before_action :load_omniauth_info, only: :github
+# frozen_string_literal: true
- def github
- @user = User.find_by(nickname: @omniauth_info.nickname) ||
- User.find_by(email: @omniauth_info.email)
+module Users
+ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
+ before_action :load_omniauth_info, only: :github
- if @user.present?
- if @omniauth_info.email.present? && @user.email != @omniauth_info.email
- # update email if it has been changed
- @user.update email: @omniauth_info.email
- end
- else # user not found
- if @omniauth_info.email.present?
+ def github
+ @user = User.find_by(nickname: @omniauth_info.nickname) ||
+ User.find_by(email: @omniauth_info.email)
+
+ if @user.present?
+ if @omniauth_info.email.present? && @user.email != @omniauth_info.email
+ # update email if it has been changed
+ @user.update email: @omniauth_info.email
+ end
+ elsif @omniauth_info.email.present? # user not found
@user = User.create_with_omniauth!(@omniauth_info)
else
set_flash_message(:error, :failure, kind: 'GitHub', reason: I18n.t('devise.errors.primary_email'))
redirect_to new_user_session_path and return
end
- end
- @user.update(@omniauth_info.slice(:name, :image).as_json)
+ @user.update(@omniauth_info.slice(:name, :image).as_json)
- sign_in_and_redirect @user, event: :authentication
- set_flash_message(:notice, :success, kind: 'GitHub') if is_navigational_format?
- end
+ sign_in_and_redirect @user, event: :authentication
+ set_flash_message(:notice, :success, kind: 'GitHub') if is_navigational_format?
+ end
- private
+ private
- def load_omniauth_info
- @omniauth_info = request.env['omniauth.auth']['info']
- unless @omniauth_info
- set_flash_message(:error, :failure, kind: 'GitHub', reason: I18n.t('devise.errors.omniauth_info'))
- redirect_to new_user_session_path and return
+ def load_omniauth_info
+ @omniauth_info = request.env['omniauth.auth']['info']
+ unless @omniauth_info
+ set_flash_message(:error, :failure, kind: 'GitHub', reason: I18n.t('devise.errors.omniauth_info'))
+ redirect_to new_user_session_path and return
+ end
end
end
end
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index adab2893..e871bf9e 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
class UsersController < ApplicationController
- before_action :authenticate_user!, :load_user, :valid_user!, except: [:login, :index]
+ before_action :authenticate_user!, :load_user, :valid_user!, except: %i[login index]
before_action :redirect_to_pretty_url, only: [:show]
def show
@@ -50,7 +52,9 @@ def users_params
params.require(:user).permit(:bitcoin_address, :password, :password_confirmation, :unsubscribed, :display_name, :denom)
end
- def load_user ; super params ; end ;
+ def load_user
+ super params
+ end
def valid_user!
if current_user != @user
diff --git a/app/controllers/withdrawals_controller.rb b/app/controllers/withdrawals_controller.rb
index 8c9168e5..8125c28a 100644
--- a/app/controllers/withdrawals_controller.rb
+++ b/app/controllers/withdrawals_controller.rb
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
class WithdrawalsController < ApplicationController
def index
@sendmanies = Sendmany.order(created_at: :desc).page(params[:page]).per(30)
end
-end
\ No newline at end of file
+end
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 398ddcee..3f3261ad 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1,8 +1,14 @@
+# frozen_string_literal: true
+
module ApplicationHelper
def btc_human(amount, options = {})
amount ||= 0
nobr = options.key?(:nobr) ? options[:nobr] : true
- denom = options.key?(:denom) ? options[:denom] : (try(:current_user) ? current_user.denom : 0)
+ denom = if options.key?(:denom)
+ options[:denom]
+ else
+ (try(:current_user) ? current_user.denom : 0)
+ end
if denom === 0
btc = to_btc(amount)
elsif denom === 1
@@ -151,8 +157,8 @@ def rate(currency, satoshies)
end
def get_rate(currency)
- Rails.cache.fetch('###' + currency, expires_in: 1.hours) do
- uri = URI('https://api.coindesk.com/v1/bpi/currentprice/' + currency + '.json')
+ Rails.cache.fetch("####{currency}", expires_in: 1.hours) do
+ uri = URI("https://api.coindesk.com/v1/bpi/currentprice/#{currency}.json")
response = Net::HTTP.get_response(uri)
hash = JSON.parse(response.body)
hash['bpi'][currency]['rate_float'].to_f
diff --git a/app/helpers/deposits_helper.rb b/app/helpers/deposits_helper.rb
index 3cf0cb4a..57be68dd 100644
--- a/app/helpers/deposits_helper.rb
+++ b/app/helpers/deposits_helper.rb
@@ -1,2 +1,4 @@
+# frozen_string_literal: true
+
module DepositsHelper
end
diff --git a/app/helpers/home_helper.rb b/app/helpers/home_helper.rb
index 23de56ac..03620959 100644
--- a/app/helpers/home_helper.rb
+++ b/app/helpers/home_helper.rb
@@ -1,2 +1,4 @@
+# frozen_string_literal: true
+
module HomeHelper
end
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index 1bb9cba0..661ec155 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -1,40 +1,41 @@
-module ProjectsHelper
+# frozen_string_literal: true
- def shield_btc_amount amount
+module ProjectsHelper
+ def shield_btc_amount(amount)
btc_amount = amount / 1e8
"%.#{9 - btc_amount.to_i.to_s.length}f Ƀ" % btc_amount
end
- def shield_color project
+ def shield_color(project)
last_tip = project.tips.order(:created_at).last
if last_tip.nil? || (Time.now - last_tip.created_at > 30.days)
'red'
- elsif (Time.now - last_tip.created_at > 7.days)
+ elsif Time.now - last_tip.created_at > 7.days
'yellow'
- elsif (Time.now - last_tip.created_at > 1.day)
+ elsif Time.now - last_tip.created_at > 1.day
'yellowgreen'
else
'green'
end
end
- def pretty_project_path project
+ def pretty_project_path(project)
"/#{project.host}/#{project.full_name}"
end
- def pretty_project_edit_path project
+ def pretty_project_edit_path(project)
"#{pretty_project_path project}/edit"
end
- def pretty_project_decide_tip_amounts_path project
+ def pretty_project_decide_tip_amounts_path(project)
"#{pretty_project_path project}/decide_tip_amounts"
end
- def pretty_project_url project
- root_url.gsub(/\/$/,'') + pretty_project_path(project)
+ def pretty_project_url(project)
+ root_url.gsub(%r{/$}, '') + pretty_project_path(project)
end
- def shield_url project
+ def shield_url(project)
project_url project, format: :svg
end
diff --git a/app/helpers/sessions_helper.rb b/app/helpers/sessions_helper.rb
index 309f8b2e..97aeb4cf 100644
--- a/app/helpers/sessions_helper.rb
+++ b/app/helpers/sessions_helper.rb
@@ -1,2 +1,4 @@
+# frozen_string_literal: true
+
module SessionsHelper
end
diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb
index 2310a240..4dc909ed 100644
--- a/app/helpers/users_helper.rb
+++ b/app/helpers/users_helper.rb
@@ -1,2 +1,4 @@
+# frozen_string_literal: true
+
module UsersHelper
end
diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb
index 08719dec..74fc2f68 100644
--- a/app/mailers/user_mailer.rb
+++ b/app/mailers/user_mailer.rb
@@ -1,16 +1,18 @@
+# frozen_string_literal: true
+
class UserMailer < ActionMailer::Base
add_template_helper(ApplicationHelper)
- def new_tip user, tip
+ def new_tip(user, tip)
@user = user
@tip = tip
- mail to: user.email, subject: "You received a tip for your commit"
+ mail to: user.email, subject: 'You received a tip for your commit'
end
- def check_bitcoin_address user
+ def check_bitcoin_address(user)
@user = user
- mail to: user.email, subject: "Check your Bitcoin address"
+ mail to: user.email, subject: 'Check your Bitcoin address'
end
end
diff --git a/app/models/ability.rb b/app/models/ability.rb
index 63f6fd78..f0a1d1e6 100644
--- a/app/models/ability.rb
+++ b/app/models/ability.rb
@@ -1,9 +1,11 @@
+# frozen_string_literal: true
+
class Ability
include CanCan::Ability
def initialize(user)
- if user and user.nickname.present?
- can [:update, :decide_tip_amounts], Project, collaborators: {login: user.nickname}
- end
+ return unless user && user.nickname.present?
+
+ can %i[update decide_tip_amounts], Project, collaborators: { login: user.nickname }
end
end
diff --git a/app/models/application_record.rb b/app/models/application_record.rb
index 863c094d..71fbba5b 100644
--- a/app/models/application_record.rb
+++ b/app/models/application_record.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ApplicationRecord < ActiveRecord::Base
- self.abstract_class = true
+ self.abstract_class = true
end
diff --git a/app/models/collaborator.rb b/app/models/collaborator.rb
index bb929bca..6232e44e 100644
--- a/app/models/collaborator.rb
+++ b/app/models/collaborator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Collaborator < ApplicationRecord
belongs_to :project
end
diff --git a/app/models/deposit.rb b/app/models/deposit.rb
index 125b306b..32906daf 100644
--- a/app/models/deposit.rb
+++ b/app/models/deposit.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Deposit < ApplicationRecord
belongs_to :project
@@ -19,11 +21,10 @@ def available_amount
end
before_create do
- self.fee_size = CONFIG["our_fee"]
+ self.fee_size = CONFIG['our_fee']
end
def project_name
project.full_name
end
-
end
diff --git a/app/models/project.rb b/app/models/project.rb
index b0ba3a47..e7380418 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Project < ApplicationRecord
acts_as_paranoid
@@ -11,11 +13,11 @@ class Project < ApplicationRecord
accepts_nested_attributes_for :tipping_policies_text
validates :full_name, :github_id, uniqueness: true, presence: true
- validates :host, inclusion: [ "github", "bitbucket" ], presence: true
+ validates :host, inclusion: %w[github bitbucket], presence: true
search_syntax do
search_by :text do |scope, phrases|
- columns = [:full_name, :host, :description, :language]
+ columns = %i[full_name host description language]
scope.where_like(columns => phrases)
end
end
@@ -24,17 +26,21 @@ class Project < ApplicationRecord
# before_save :check_tips_to_pay_against_avaiable_amount
- def update_repository_info repo
+ def update_repository_info(repo)
self.github_id = repo.id
self.name = repo.name
self.full_name = repo.full_name
- self.source_full_name = repo.source.full_name rescue ''
+ self.source_full_name = begin
+ repo.source.full_name
+ rescue StandardError
+ ''
+ end
self.description = repo.description
self.watchers_count = repo.watchers_count
self.language = repo.language
self.avatar_url = repo.organization.rels[:avatar].href if repo.organization.present?
- self.save!
+ save!
end
def update_collaborators(repo_collaborators)
@@ -44,24 +50,18 @@ def update_collaborators(repo_collaborators)
existing_logins = existing_collaborators.map(&:login)
existing_collaborators.each do |existing_collaborator|
- unless repo_logins.include?(existing_collaborator.login)
- existing_collaborator.mark_for_destruction
- end
+ existing_collaborator.mark_for_destruction unless repo_logins.include?(existing_collaborator.login)
end
repo_collaborators.each do |repo_collaborator|
- unless existing_logins.include?(repo_collaborator)
- collaborators.build(login: repo_collaborator)
- end
+ collaborators.build(login: repo_collaborator) unless existing_logins.include?(repo_collaborator)
end
save!
end
def repository_client
- if host.present?
- host.classify.constantize.new
- end
+ host.classify.constantize.new if host.present?
end
def github_url
@@ -90,15 +90,15 @@ def branches
def new_commits
begin
- commits = Timeout::timeout(90) do
+ commits = Timeout.timeout(90) do
raw_commits.
# Filter merge request
- select{|c| !(c.commit.message =~ /^(Merge\s|auto\smerge)/)}.
+ reject { |c| (c.commit.message =~ /^(Merge\s|auto\smerge)/) }.
# Filter fake emails
- select{|c| c.commit.author.email =~ Devise::email_regexp }.
+ select { |c| c.commit.author.email =~ Devise.email_regexp }.
# Filter commited after t4c project creation
- select{|c| c.commit.committer.date > self.deposits.first.created_at }.
- to_a.
+ select { |c| c.commit.committer.date > deposits.first.created_at }
+ .to_a.
# tip for older commits first
reverse
end
@@ -121,23 +121,23 @@ def tip_commits
end
end
- def tip_for commit
- if (next_tip_amount > 0) && !Tip.exists?(commit: commit.sha)
+ def tip_for(commit)
+ if next_tip_amount.positive? && !Tip.exists?(commit: commit.sha)
return unless (user = User.find_by_commit commit)
user.update(nickname: commit.author.login) if commit.author.try(:login)
- if hold_tips
- amount = nil
- else
- amount = next_tip_amount
- end
+ amount = if hold_tips
+ nil
+ else
+ next_tip_amount
+ end
# create tip
- tip = self.tips.create({ user: user,
- amount: amount,
- commit: commit.sha,
- commit_message: commit.commit.message })
+ tip = tips.create({ user: user,
+ amount: amount,
+ commit: commit.sha,
+ commit_message: commit.commit.message })
# tip.notify_user
@@ -146,7 +146,7 @@ def tip_for commit
end
def donated
- self.deposits.confirmed.map(&:available_amount).sum
+ deposits.confirmed.map(&:available_amount).sum
end
def available_amount
@@ -154,20 +154,20 @@ def available_amount
end
def unconfirmed_amount
- self.deposits.unconfirmed.where('created_at > ?', 7.days.ago).map(&:available_amount).sum
+ deposits.unconfirmed.where('created_at > ?', 7.days.ago).map(&:available_amount).sum
end
def tips_paid_amount
- self.tips.decided.non_refunded.sum(:amount)
+ tips.decided.non_refunded.sum(:amount)
end
def tips_paid_unclaimed_amount
- self.tips.decided.non_refunded.unclaimed.sum(:amount)
+ tips.decided.non_refunded.unclaimed.sum(:amount)
end
def next_tip_amount
- next_tip_amount = (CONFIG["tip"]*available_amount).ceil
- next_tip_amount = [next_tip_amount, CONFIG["min_tip"]].max if CONFIG["min_tip"]
+ next_tip_amount = (CONFIG['tip'] * available_amount).ceil
+ next_tip_amount = [next_tip_amount, CONFIG['min_tip']].max if CONFIG['min_tip']
next_tip_amount = [next_tip_amount, available_amount].min
end
@@ -176,29 +176,25 @@ def update_cache
end
def self.update_cache
- find_each do |project|
- project.update_cache
- end
+ find_each(&:update_cache)
end
def update_info
- begin
- update_repository_info(repository_info)
- update_collaborators(collaborators_info)
- rescue Octokit::BadGateway, Octokit::NotFound, Octokit::InternalServerError, Octokit::Forbidden,
- Errno::ETIMEDOUT, Net::ReadTimeout, Faraday::Error::ConnectionFailed => e
- Rails.logger.info "Project ##{id}: #{e.class} happened"
- rescue StandardError => e
- Airbrake.notify(e)
- end
+ update_repository_info(repository_info)
+ update_collaborators(collaborators_info)
+ rescue Octokit::BadGateway, Octokit::NotFound, Octokit::InternalServerError, Octokit::Forbidden,
+ Errno::ETIMEDOUT, Net::ReadTimeout, Faraday::Error::ConnectionFailed => e
+ Rails.logger.info "Project ##{id}: #{e.class} happened"
+ rescue StandardError => e
+ Airbrake.notify(e)
end
def amount_to_pay
- self.tips.to_pay.sum(:amount)
+ tips.to_pay.sum(:amount)
end
def has_undecided_tips?
- self.tips.undecided.any?
+ tips.undecided.any?
end
def commit_url(commit)
@@ -206,25 +202,25 @@ def commit_url(commit)
end
def check_tips_to_pay_against_avaiable_amount
- if available_amount < 0
+ if available_amount.negative?
raise "Not enough funds to pay the pending tips on #{inspect} (#{available_amount} < 0)"
end
end
- def self.find_or_create_by_url project_url
- project_name = project_url.
- gsub(/https?\:\/\/github.com\//, '').
- gsub(/\#.+$/, '').
- gsub(' ', '')
+ def self.find_or_create_by_url(project_url)
+ project_name = project_url
+ .gsub(%r{https?://github.com/}, '')
+ .gsub(/\#.+$/, '')
+ .gsub(' ', '')
Github.new.find_or_create_project project_name
end
- def self.find_by_url project_url
- project_name = project_url.
- gsub(/https?\:\/\/github.com\//, '').
- gsub(/\#.+$/, '').
- gsub(' ', '')
+ def self.find_by_url(project_url)
+ project_name = project_url
+ .gsub(%r{https?://github.com/}, '')
+ .gsub(/\#.+$/, '')
+ .gsub(' ', '')
Github.new.find_project project_name
end
@@ -232,6 +228,7 @@ def self.find_by_url project_url
def generate_bitcoin_address
wallet = Wallet.order(created_at: :asc).last
return unless wallet
+
self.wallet = wallet
self.bitcoin_address = wallet.generate_address
save
diff --git a/app/models/sendmany.rb b/app/models/sendmany.rb
index bda180b4..67a020e5 100644
--- a/app/models/sendmany.rb
+++ b/app/models/sendmany.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Sendmany < ApplicationRecord
has_many :tips
@@ -10,13 +12,12 @@ def send_transaction
update_attribute :is_error, true # it's a lock to prevent duplicates
-
- bitcoind = BitcoinRPC.new(CONFIG["bitcoind"]["rpc_connection_string"],false)
+ bitcoind = BitcoinRPC.new(CONFIG['bitcoind']['rpc_connection_string'], false)
begin
txid = bitcoind.sendmany(
- CONFIG["bitcoind"]["account"],
- JSON.parse(data).map { |address, amount| {address => amount/1e8} }.inject(&:merge)
+ CONFIG['bitcoind']['account'],
+ JSON.parse(data).map { |address, amount| { address => amount / 1e8 } }.inject(&:merge)
)
if txid.present?
update_attribute :is_error, false
@@ -25,11 +26,10 @@ def send_transaction
rescue StandardError => e
update_attribute :result, e.inspect
end
-
end
def to_csv
- JSON.parse(self.data).map do |address, value|
+ JSON.parse(data).map do |address, value|
[address, value / 1e8].join(',')
end.join("\n")
end
diff --git a/app/models/tip.rb b/app/models/tip.rb
index 120859c6..f80c234b 100644
--- a/app/models/tip.rb
+++ b/app/models/tip.rb
@@ -1,76 +1,88 @@
+# frozen_string_literal: true
+
class Tip < ApplicationRecord
belongs_to :user
belongs_to :sendmany
belongs_to :project, inverse_of: :tips
AVAILABLE_AMOUNTS = [
- ['undecided', ""],
+ ['undecided', ''],
['free', 0],
['tiny', 0.1],
['small', 0.5],
['normal', 1],
['big', 2],
['huge', 5]
- ]
+ ].freeze
validates :amount, numericality: { greater_or_equal_than: 0, allow_nil: true }
- scope :not_sent, -> { where(sendmany_id: nil) }
+ scope :not_sent, -> { where(sendmany_id: nil) }
+
def not_sent?
sendmany_id.nil?
end
- scope :unpaid, -> { non_refunded.not_sent }
+ scope :unpaid, -> { non_refunded.not_sent }
+
def unpaid?
non_refunded? and not_sent?
end
- scope :to_pay, -> { unpaid.decided.not_free.with_address }
+ scope :to_pay, -> { unpaid.decided.not_free.with_address }
+
def to_pay?
unpaid? and decided? and !free? and with_address?
end
scope :free, -> { where('amount = 0') }
scope :not_free, -> { where('amount > 0') }
+
def free?
- amount == 0
+ amount.zero?
end
- scope :paid, -> { where.not(sendmany_id: nil) }
+ scope :paid, -> { where.not(sendmany_id: nil) }
+
def paid?
!!sendmany_id
end
- scope :refunded, -> { where.not(refunded_at: nil) }
+ scope :refunded, -> { where.not(refunded_at: nil) }
+
def refunded?
!!refunded_at
end
- scope :non_refunded, -> { where(refunded_at: nil) }
+ scope :non_refunded, -> { where(refunded_at: nil) }
+
def non_refunded?
!refunded?
end
- scope :unclaimed, -> { joins(:user).
- unpaid.
- where('users.bitcoin_address' => ['', nil]) }
+ scope :unclaimed, -> { joins(:user).unpaid.where('users.bitcoin_address' => ['', nil]) }
+
def claimed?
paid? || user.bitcoin_address.present?
end
+
def unclaimed?
!claimed?
end
- scope :with_address, -> { joins(:user).where.not('users.bitcoin_address' => ['', nil]) }
+ scope :with_address, -> { joins(:user).where.not('users.bitcoin_address' => ['', nil]) }
+
def with_address?
user.bitcoin_address.present?
end
scope :decided, -> { where.not(amount: nil) }
scope :undecided, -> { where(amount: nil) }
+
def decided?
!!amount
end
+
def undecided?
!decided?
end
@@ -80,18 +92,18 @@ def undecided?
after_save :notify_user_if_just_decided
def self.refund_unclaimed
- unclaimed.non_refunded.
- where.not(decided_at: nil).
- where('tips.decided_at < ?', 1.month.ago).
- find_each do |tip|
+ unclaimed.non_refunded
+ .where.not(decided_at: nil)
+ .where('tips.decided_at < ?', 1.month.ago)
+ .find_each do |tip|
tip.touch :refunded_at
end
end
def self.auto_decide_older_tips
- undecided.non_refunded.
- where('tips.created_at < ?', 1.month.ago).
- find_each do |tip|
+ undecided.non_refunded
+ .where('tips.created_at < ?', 1.month.ago)
+ .find_each do |tip|
tip.amount_percentage = 1
tip.save
end
@@ -106,16 +118,18 @@ def amount_percentage
end
def amount_percentage=(percentage)
- if undecided? and percentage.present? and AVAILABLE_AMOUNTS.map(&:last).compact.map(&:to_s).include?(percentage.to_s)
- self.amount = (project.available_amount * (percentage.to_f / 100)).ceil
- end
+ return if decided?
+ return if percentage.blank?
+ return unless AVAILABLE_AMOUNTS.map(&:last).compact.map(&:to_s).include?(percentage.to_s)
+
+ self.amount = (project.available_amount * (percentage.to_f / 100)).ceil
end
def notify_user
- if amount && amount > 0 && user.bitcoin_address.blank? &&
- !user.unsubscribed && !project.disable_notifications &&
- user.balance > 21000000*1e8
- if user.notified_at.nil? or user.notified_at < 30.days.ago
+ if amount&.positive? && user.bitcoin_address.blank? &&
+ !user.unsubscribed && !project.disable_notifications &&
+ user.balance > 21_000_000 * 1e8
+ if user.notified_at.nil? || (user.notified_at < 30.days.ago)
begin
UserMailer.new_tip(user, self).deliver
user.touch :notified_at
@@ -127,7 +141,7 @@ def notify_user
end
def notify_user_if_just_decided
- notify_user if amount_was.nil? and amount
+ notify_user if amount_was.nil? && amount
end
def check_amount_against_project
@@ -155,5 +169,4 @@ def user_name
def txid
try(:sendmany).try(:txid)
end
-
end
diff --git a/app/models/tipping_policies_text.rb b/app/models/tipping_policies_text.rb
index 5e6a3a55..96188039 100644
--- a/app/models/tipping_policies_text.rb
+++ b/app/models/tipping_policies_text.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TippingPoliciesText < ApplicationRecord
belongs_to :project
belongs_to :user
diff --git a/app/models/user.rb b/app/models/user.rb
index 6dbbe3c4..30cdf25e 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -1,10 +1,12 @@
+# frozen_string_literal: true
+
class User < ApplicationRecord
# Include default devise modules. Others available are:
# :lockable, :timeoutable
devise :database_authenticatable, :registerable, :recoverable,
:rememberable, :trackable, :validatable, :confirmable
- devise :omniauthable, :omniauth_providers => [:github]
+ devise :omniauthable, omniauth_providers: [:github]
# Validations
validates :bitcoin_address, bitcoin_address: true
@@ -29,19 +31,15 @@ def denom
end
def gravatar_bitcoin
- begin
- gravatar.get_value :currency, :bitcoin
- rescue URI::InvalidURIError, NoMethodError => e
- nil
- end
+ gravatar.get_value :currency, :bitcoin
+ rescue URI::InvalidURIError, NoMethodError => e
+ nil
end
def gravatar_display_name
- begin
- gravatar.get_value :displayName
- rescue URI::InvalidURIError, NoMethodError => e
- nil
- end
+ gravatar.get_value :displayName
+ rescue URI::InvalidURIError, NoMethodError => e
+ nil
end
def display_name
@@ -79,13 +77,13 @@ def self.find_by_commit(commit)
end
def ready_for_withdrawal?
- self.bitcoin_address.present? && self.balance >= CONFIG["min_payout"]
+ bitcoin_address.present? && balance >= CONFIG['min_payout']
end
private
def gravatar
- @gravatar ||= Gravatar::new(email)
+ @gravatar ||= Gravatar.new(email)
end
def set_login_token!
diff --git a/app/models/wallet.rb b/app/models/wallet.rb
index 20d6de30..920f70b3 100644
--- a/app/models/wallet.rb
+++ b/app/models/wallet.rb
@@ -1,5 +1,6 @@
-class Wallet < ApplicationRecord
+# frozen_string_literal: true
+class Wallet < ApplicationRecord
validates :name, :xpub, presence: true
def generate_address
diff --git a/app/services/bitbucket.rb b/app/services/bitbucket.rb
index 207e050a..6a7ed534 100644
--- a/app/services/bitbucket.rb
+++ b/app/services/bitbucket.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'sawyer'
class Bitbucket
@@ -11,34 +13,39 @@ class Bitbucket
attr_reader :agent
def initialize
- @agent = Sawyer::Agent.new("https://bitbucket.org")
+ @agent = Sawyer::Agent.new('https://bitbucket.org')
end
- def repository_info repository
+ def repository_info(repository)
data = request :get, repository_path(repository.full_name)
Repository.new(
data.slug,
data.name,
repository.full_name,
- (data.fork_of.owner + "/" + data.fork_of.slug rescue ''),
+ begin
+ "#{data.fork_of.owner}/#{data.fork_of.slug}"
+ rescue StandardError
+ ''
+ end,
data.description,
data.followers_count,
- data.language)
+ data.language
+ )
end
- def collaborators_info project
+ def collaborators_info(_project)
# TODO
[]
end
- def branches project
+ def branches(_project)
# TODO
['master']
end
- def commits repository
- # todo use repository.branch
+ def commits(repository)
+ # TODO: use repository.branch
data = request :get, changesets_path(repository.full_name)
data.changesets.map do |cs|
@@ -51,32 +58,33 @@ def commits repository
end
end
- def repository_url project
+ def repository_url(project)
"https://bitbucket.org/#{project.full_name}"
end
- def source_repository_url project
+ def source_repository_url(project)
"https://bitbucket.org/#{project.source_full_name}"
end
- def commit_url project, commit
+ def commit_url(project, commit)
"https://bitbucket.org/#{project.full_name}/commits/#{commit}"
end
protected
- def repository_path full_name
+
+ def repository_path(full_name)
"#{base_path}#{full_name}"
end
- def changesets_path full_name
+ def changesets_path(full_name)
"#{base_path}#{full_name}/changesets?limit=15"
end
def base_path
- "/api/1.0/repositories/"
+ '/api/1.0/repositories/'
end
- def request method, path
+ def request(method, path)
agent.call(method, path).data
end
end
diff --git a/app/services/github.rb b/app/services/github.rb
index 8d8954ba..073f4c22 100644
--- a/app/services/github.rb
+++ b/app/services/github.rb
@@ -1,22 +1,24 @@
+# frozen_string_literal: true
+
class Github
def initialize
options = { client_id: CONFIG['github']['key'], client_secret: CONFIG['github']['secret'] }
if CONFIG['github']['auto_paginate']
- options.merge! :auto_paginate => true
+ options.merge! auto_paginate: true
else
- options.merge! :per_page => 100
+ options.merge! per_page: 100
end
@client = Octokit::Client.new(options)
end
attr_reader :client
- def commits project
- if project.branch.blank?
- commits = client.commits project.full_name
- else
- commits = client.commits project.full_name, sha: project.branch
- end
+ def commits(project)
+ commits = if project.branch.blank?
+ client.commits project.full_name
+ else
+ client.commits project.full_name, sha: project.branch
+ end
last_response = client.last_response
pages = (CONFIG['github']['project_pages'][project.full_name] || CONFIG['github']['pages'] || 1).to_i
@@ -30,10 +32,11 @@ def commits project
commits
end
- def repository_info project
- if project.is_a?(String)
+ def repository_info(project)
+ case project
+ when String
client.repo project
- elsif project.is_a?(Project)
+ when Project
if project.github_id.present?
client.get "/repositories/#{project.github_id}"
else
@@ -44,33 +47,39 @@ def repository_info project
end
end
- def find_or_create_project project_name
+ def find_or_create_project(project_name)
if project = find_project(project_name)
project
- elsif project_name =~ /\w+\/\w+/
+ elsif project_name =~ %r{\w+/\w+}
begin
repo = repository_info project_name
- project = Project.find_or_create_by host: "github", full_name: repo.full_name
+ project = Project.find_or_create_by host: 'github', full_name: repo.full_name
project.update_repository_info repo
project
rescue Octokit::NotFound
nil
end
- else
- nil
end
end
- def find_project project_name
- return Project.find_by(host: "github", full_name: project_name)
+ def find_project(project_name)
+ Project.find_by(host: 'github', full_name: project_name)
end
- def collaborators_info project
- (client.get("/repos/#{project.full_name}/collaborators").map(&:login) rescue [project.full_name.split('/').first]) +
- (client.get("/orgs/#{project.full_name.split('/').first}/members").map(&:login) rescue [])
+ def collaborators_info(project)
+ begin
+ client.get("/repos/#{project.full_name}/collaborators").map(&:login)
+ rescue StandardError
+ [project.full_name.split('/').first]
+ end +
+ begin
+ client.get("/orgs/#{project.full_name.split('/').first}/members").map(&:login)
+ rescue StandardError
+ []
+ end
end
- def branches project
+ def branches(project)
branches = client.get("/repos/#{project.full_name}/branches")
last_response = client.last_response
while last_response && last_response.rels[:next]
@@ -80,15 +89,15 @@ def branches project
branches.map(&:name)
end
- def repository_url project
+ def repository_url(project)
"https://github.com/#{project.full_name}"
end
- def source_repository_url project
+ def source_repository_url(project)
"https://github.com/#{project.source_full_name}"
end
- def commit_url project, commit
+ def commit_url(project, commit)
"https://github.com/#{project.full_name}/commit/#{commit}"
end
end
diff --git a/bin/airbrake b/bin/airbrake
deleted file mode 100755
index b29b0771..00000000
--- a/bin/airbrake
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env ruby
-#
-# This file was generated by Bundler.
-#
-# The application 'airbrake' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require 'pathname'
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-require 'rubygems'
-require 'bundler/setup'
-
-load Gem.bin_path('airbrake', 'airbrake')
diff --git a/bin/bundle b/bin/bundle
deleted file mode 100755
index 66e9889e..00000000
--- a/bin/bundle
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
-load Gem.bin_path('bundler', 'bundle')
diff --git a/bin/bundler b/bin/bundler
deleted file mode 100755
index 72c62ec0..00000000
--- a/bin/bundler
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env ruby
-#
-# This file was generated by Bundler.
-#
-# The application 'bundler' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require 'pathname'
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-require 'rubygems'
-require 'bundler/setup'
-
-load Gem.bin_path('bundler', 'bundler')
diff --git a/bin/cap b/bin/cap
deleted file mode 100755
index 30352d4d..00000000
--- a/bin/cap
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env ruby
-#
-# This file was generated by Bundler.
-#
-# The application 'cap' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require 'pathname'
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-require 'rubygems'
-require 'bundler/setup'
-
-load Gem.bin_path('capistrano', 'cap')
diff --git a/bin/cdiff b/bin/cdiff
deleted file mode 100755
index 066279d2..00000000
--- a/bin/cdiff
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env ruby
-#
-# This file was generated by Bundler.
-#
-# The application 'cdiff' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require 'pathname'
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-require 'rubygems'
-require 'bundler/setup'
-
-load Gem.bin_path('term-ansicolor', 'cdiff')
diff --git a/bin/colortab b/bin/colortab
deleted file mode 100755
index 195df76f..00000000
--- a/bin/colortab
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env ruby
-#
-# This file was generated by Bundler.
-#
-# The application 'colortab' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require 'pathname'
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-require 'rubygems'
-require 'bundler/setup'
-
-load Gem.bin_path('term-ansicolor', 'colortab')
diff --git a/bin/decolor b/bin/decolor
deleted file mode 100755
index 214e8d18..00000000
--- a/bin/decolor
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env ruby
-#
-# This file was generated by Bundler.
-#
-# The application 'decolor' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require 'pathname'
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-require 'rubygems'
-require 'bundler/setup'
-
-load Gem.bin_path('term-ansicolor', 'decolor')
diff --git a/bin/erubis b/bin/erubis
deleted file mode 100755
index 2c7348b8..00000000
--- a/bin/erubis
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env ruby
-#
-# This file was generated by Bundler.
-#
-# The application 'erubis' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require 'pathname'
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-require 'rubygems'
-require 'bundler/setup'
-
-load Gem.bin_path('erubis', 'erubis')
diff --git a/bin/haml b/bin/haml
deleted file mode 100755
index 3c6d074f..00000000
--- a/bin/haml
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env ruby
-#
-# This file was generated by Bundler.
-#
-# The application 'haml' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require 'pathname'
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-require 'rubygems'
-require 'bundler/setup'
-
-load Gem.bin_path('haml', 'haml')
diff --git a/bin/lessc b/bin/lessc
deleted file mode 100755
index 833b943e..00000000
--- a/bin/lessc
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env ruby
-#
-# This file was generated by Bundler.
-#
-# The application 'lessc' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require 'pathname'
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-require 'rubygems'
-require 'bundler/setup'
-
-load Gem.bin_path('less', 'lessc')
diff --git a/bin/rackup b/bin/rackup
deleted file mode 100755
index 8cc9953e..00000000
--- a/bin/rackup
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env ruby
-#
-# This file was generated by Bundler.
-#
-# The application 'rackup' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require 'pathname'
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-require 'rubygems'
-require 'bundler/setup'
-
-load Gem.bin_path('rack', 'rackup')
diff --git a/bin/rails b/bin/rails
deleted file mode 100755
index 728cd85a..00000000
--- a/bin/rails
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/usr/bin/env ruby
-APP_PATH = File.expand_path('../../config/application', __FILE__)
-require_relative '../config/boot'
-require 'rails/commands'
diff --git a/bin/rake b/bin/rake
deleted file mode 100755
index 17240489..00000000
--- a/bin/rake
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/usr/bin/env ruby
-require_relative '../config/boot'
-require 'rake'
-Rake.application.run
diff --git a/bin/rdoc b/bin/rdoc
deleted file mode 100755
index f57260f3..00000000
--- a/bin/rdoc
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env ruby
-#
-# This file was generated by Bundler.
-#
-# The application 'rdoc' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require 'pathname'
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-require 'rubygems'
-require 'bundler/setup'
-
-load Gem.bin_path('rdoc', 'rdoc')
diff --git a/bin/ri b/bin/ri
deleted file mode 100755
index 90f2517d..00000000
--- a/bin/ri
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env ruby
-#
-# This file was generated by Bundler.
-#
-# The application 'ri' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require 'pathname'
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-require 'rubygems'
-require 'bundler/setup'
-
-load Gem.bin_path('rdoc', 'ri')
diff --git a/bin/sass b/bin/sass
deleted file mode 100755
index d65bb10a..00000000
--- a/bin/sass
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env ruby
-#
-# This file was generated by Bundler.
-#
-# The application 'sass' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require 'pathname'
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-require 'rubygems'
-require 'bundler/setup'
-
-load Gem.bin_path('sass', 'sass')
diff --git a/bin/sass-convert b/bin/sass-convert
deleted file mode 100755
index ddde743f..00000000
--- a/bin/sass-convert
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env ruby
-#
-# This file was generated by Bundler.
-#
-# The application 'sass-convert' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require 'pathname'
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-require 'rubygems'
-require 'bundler/setup'
-
-load Gem.bin_path('sass', 'sass-convert')
diff --git a/bin/scss b/bin/scss
deleted file mode 100755
index 9f5e435d..00000000
--- a/bin/scss
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env ruby
-#
-# This file was generated by Bundler.
-#
-# The application 'scss' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require 'pathname'
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-require 'rubygems'
-require 'bundler/setup'
-
-load Gem.bin_path('sass', 'scss')
diff --git a/bin/sdoc b/bin/sdoc
deleted file mode 100755
index 9da297e6..00000000
--- a/bin/sdoc
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env ruby
-#
-# This file was generated by Bundler.
-#
-# The application 'sdoc' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require 'pathname'
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-require 'rubygems'
-require 'bundler/setup'
-
-load Gem.bin_path('sdoc', 'sdoc')
diff --git a/bin/sdoc-merge b/bin/sdoc-merge
deleted file mode 100755
index e29a7d95..00000000
--- a/bin/sdoc-merge
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env ruby
-#
-# This file was generated by Bundler.
-#
-# The application 'sdoc-merge' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require 'pathname'
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-require 'rubygems'
-require 'bundler/setup'
-
-load Gem.bin_path('sdoc', 'sdoc-merge')
diff --git a/bin/slimrb b/bin/slimrb
deleted file mode 100755
index d9152e29..00000000
--- a/bin/slimrb
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env ruby
-#
-# This file was generated by Bundler.
-#
-# The application 'slimrb' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require 'pathname'
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-require 'rubygems'
-require 'bundler/setup'
-
-load Gem.bin_path('slim', 'slimrb')
diff --git a/bin/sprockets b/bin/sprockets
deleted file mode 100755
index 09a1ad18..00000000
--- a/bin/sprockets
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env ruby
-#
-# This file was generated by Bundler.
-#
-# The application 'sprockets' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require 'pathname'
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-require 'rubygems'
-require 'bundler/setup'
-
-load Gem.bin_path('sprockets', 'sprockets')
diff --git a/bin/term_display b/bin/term_display
deleted file mode 100755
index d65c316b..00000000
--- a/bin/term_display
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env ruby
-#
-# This file was generated by Bundler.
-#
-# The application 'term_display' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require 'pathname'
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-require 'rubygems'
-require 'bundler/setup'
-
-load Gem.bin_path('term-ansicolor', 'term_display')
diff --git a/bin/term_mandel b/bin/term_mandel
deleted file mode 100755
index c7dd35e6..00000000
--- a/bin/term_mandel
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env ruby
-#
-# This file was generated by Bundler.
-#
-# The application 'term_mandel' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require 'pathname'
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-require 'rubygems'
-require 'bundler/setup'
-
-load Gem.bin_path('term-ansicolor', 'term_mandel')
diff --git a/bin/thor b/bin/thor
deleted file mode 100755
index 8421e001..00000000
--- a/bin/thor
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env ruby
-#
-# This file was generated by Bundler.
-#
-# The application 'thor' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require 'pathname'
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-require 'rubygems'
-require 'bundler/setup'
-
-load Gem.bin_path('thor', 'thor')
diff --git a/bin/tilt b/bin/tilt
deleted file mode 100755
index 09fe73eb..00000000
--- a/bin/tilt
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env ruby
-#
-# This file was generated by Bundler.
-#
-# The application 'tilt' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require 'pathname'
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-require 'rubygems'
-require 'bundler/setup'
-
-load Gem.bin_path('tilt', 'tilt')
diff --git a/bin/tt b/bin/tt
deleted file mode 100755
index 6e3920b8..00000000
--- a/bin/tt
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env ruby
-#
-# This file was generated by Bundler.
-#
-# The application 'tt' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require 'pathname'
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-require 'rubygems'
-require 'bundler/setup'
-
-load Gem.bin_path('treetop', 'tt')
diff --git a/config.ru b/config.ru
index 5bc2a619..667e328d 100644
--- a/config.ru
+++ b/config.ru
@@ -1,4 +1,6 @@
+# frozen_string_literal: true
+
# This file is used by Rack-based servers to start the application.
-require ::File.expand_path('../config/environment', __FILE__)
+require ::File.expand_path('config/environment', __dir__)
run Rails.application
diff --git a/config/application.rb b/config/application.rb
index d700c1f9..e2412382 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -1,4 +1,6 @@
-require File.expand_path('../boot', __FILE__)
+# frozen_string_literal: true
+
+require File.expand_path('boot', __dir__)
require 'rails/all'
diff --git a/config/boot.rb b/config/boot.rb
index 35967366..a7f5578c 100644
--- a/config/boot.rb
+++ b/config/boot.rb
@@ -1,4 +1,6 @@
+# frozen_string_literal: true
+
# Set up gems listed in the Gemfile.
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
-require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
+require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
diff --git a/config/deploy.rb b/config/deploy.rb
index bfc89d0d..275e612a 100644
--- a/config/deploy.rb
+++ b/config/deploy.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
set :application, 't4c'
set :repo_url, 'git@github.com:tip4commit/tip4commit.git'
diff --git a/config/deploy/production.rb b/config/deploy/production.rb
index 06838c2e..13bcd143 100644
--- a/config/deploy/production.rb
+++ b/config/deploy/production.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
set :stage, :production
# Simple Role Syntax
@@ -5,9 +7,9 @@
# Supports bulk-adding hosts to roles, the primary
# server in each group is considered to be the first
# unless any hosts have the primary property set.
-role :app, %w{apps@50.116.2.58}
-role :web, %w{apps@50.116.2.58}
-role :db, %w{apps@50.116.2.58}
+role :app, %w[apps@50.116.2.58]
+role :web, %w[apps@50.116.2.58]
+role :db, %w[apps@50.116.2.58]
set :rails_env, 'production'
set :migration_role, 'db'
@@ -18,7 +20,7 @@
# definition into the server list. The second argument
# something that quacks like a has can be used to set
# extended properties on the server.
-#server 'example.com', user: 'deploy', roles: %w{web app}, my_property: :my_value
+# server 'example.com', user: 'deploy', roles: %w{web app}, my_property: :my_value
# you can set custom ssh options
# it's possible to pass any option but you need to keep in mind that net/ssh understand limited list of options
diff --git a/config/deploy/staging.rb b/config/deploy/staging.rb
index 0966af3f..10193a00 100644
--- a/config/deploy/staging.rb
+++ b/config/deploy/staging.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
set :stage, :staging
# Simple Role Syntax
@@ -5,9 +7,9 @@
# Supports bulk-adding hosts to roles, the primary
# server in each group is considered to be the first
# unless any hosts have the primary property set.
-role :app, %w{deploy@example.com}
-role :web, %w{deploy@example.com}
-role :db, %w{deploy@example.com}
+role :app, %w[deploy@example.com]
+role :web, %w[deploy@example.com]
+role :db, %w[deploy@example.com]
# Extended Server Syntax
# ======================
@@ -15,7 +17,7 @@
# definition into the server list. The second argument
# something that quacks like a has can be used to set
# extended properties on the server.
-server 'example.com', user: 'deploy', roles: %w{web app}, my_property: :my_value
+server 'example.com', user: 'deploy', roles: %w[web app], my_property: :my_value
# you can set custom ssh options
# it's possible to pass any option but you need to keep in mind that net/ssh understand limited list of options
diff --git a/config/environment.rb b/config/environment.rb
index 8fc35cc4..52ee9669 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
# Load the Rails application.
-require File.expand_path('../application', __FILE__)
+require File.expand_path('application', __dir__)
# Initialize the Rails application.
T4c::Application.initialize!
diff --git a/config/environments/development.rb b/config/environments/development.rb
index 42389197..f73b9c9c 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
T4c::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
@@ -16,7 +18,7 @@
# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false
- config.action_mailer.default_url_options = { :host => "localhost:3000" }
+ config.action_mailer.default_url_options = { host: 'localhost:3000' }
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
diff --git a/config/environments/production.rb b/config/environments/production.rb
index 1d827f7b..d2103f50 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
T4c::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
@@ -68,8 +70,8 @@
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
- config.action_mailer.default_url_options = { :host => domain, :protocol => 'https' }
- config.action_mailer.default_options = {from: 'no-reply@' + domain }
+ config.action_mailer.default_url_options = { host: domain, protocol: 'https' }
+ config.action_mailer.default_options = { from: "no-reply@#{domain}" }
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation can not be found).
diff --git a/config/environments/test.rb b/config/environments/test.rb
index a24b44ba..569bd0cf 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
T4c::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
@@ -13,8 +15,8 @@
config.eager_load = false
# Configure static asset server for tests with Cache-Control for performance.
- config.serve_static_files = true
- config.static_cache_control = "public, max-age=3600"
+ config.serve_static_files = true
+ config.static_cache_control = 'public, max-age=3600'
# Show full error reports and disable caching.
config.consider_all_requests_local = true
@@ -31,7 +33,7 @@
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
config.action_mailer.raise_delivery_errors = false
- config.action_mailer.default_url_options = { :host => 'tip4commit.com', :protocol => 'https' }
+ config.action_mailer.default_url_options = { host: 'tip4commit.com', protocol: 'https' }
config.action_mailer.default_options = { from: 'no-reply@tip4commit.com' }
# Print deprecation notices to the stderr.
diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb
index 59385cdf..d0f0d3b5 100644
--- a/config/initializers/backtrace_silencers.rb
+++ b/config/initializers/backtrace_silencers.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
diff --git a/config/initializers/blacklist.rb b/config/initializers/blacklist.rb
index c1b09c04..9bd4146b 100644
--- a/config/initializers/blacklist.rb
+++ b/config/initializers/blacklist.rb
@@ -1,2 +1,4 @@
+# frozen_string_literal: true
+
# Load the blacklist.
-BLACKLIST ||= Blacklist.new(YAML.load_file("config/blacklist.yml"))
+BLACKLIST ||= Blacklist.new(YAML.load_file('config/blacklist.yml'))
diff --git a/config/initializers/demoji.rb b/config/initializers/demoji.rb
index f2258a95..b1ce2207 100644
--- a/config/initializers/demoji.rb
+++ b/config/initializers/demoji.rb
@@ -1 +1,3 @@
-ActiveRecord::Base.send :include, Demoji
\ No newline at end of file
+# frozen_string_literal: true
+
+ActiveRecord::Base.include Demoji
diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb
index 2501563d..82fa1b11 100644
--- a/config/initializers/devise.rb
+++ b/config/initializers/devise.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Use this hook to configure devise mailer, warden hooks and so forth.
# Many of these configuration options can be set straight in your model.
Devise.setup do |config|
@@ -10,7 +12,7 @@
# Configure the e-mail address which will be shown in Devise::Mailer,
# note that it will be overwritten if you use your own mailer class
# with default "from" parameter.
- config.mailer_sender = 'no-reply@' + CONFIG['smtp_settings']['domain']
+ config.mailer_sender = "no-reply@#{CONFIG['smtp_settings']['domain']}"
# Configure the class responsible to send e-mails.
# config.mailer = 'Devise::Mailer'
@@ -41,12 +43,12 @@
# Configure which authentication keys should be case-insensitive.
# These keys will be downcased upon creating or modifying a user and when used
# to authenticate or find a user. Default is :email.
- config.case_insensitive_keys = [ :email ]
+ config.case_insensitive_keys = [:email]
# Configure which authentication keys should have whitespace stripped.
# These keys will have whitespace before and after removed upon creating or
# modifying a user and when used to authenticate or find a user. Default is :email.
- config.strip_whitespace_keys = [ :email ]
+ config.strip_whitespace_keys = [:email]
# Tell if authentication through request.params is enabled. True by default.
# It can be set to an array that will enable params authentication only for the
diff --git a/config/initializers/errbit.rb b/config/initializers/errbit.rb
index d6e0dbdf..d1ef6af4 100644
--- a/config/initializers/errbit.rb
+++ b/config/initializers/errbit.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
if CONFIG['airbrake']
Airbrake.configure do |config|
config.api_key = CONFIG['airbrake']['api_key']
@@ -5,7 +7,7 @@
config.port = 80
config.secure = config.port == 443
- config.ignore << "ArgumentError"
- config.ignore << "ActionController::UnknownFormat"
+ config.ignore << 'ArgumentError'
+ config.ignore << 'ActionController::UnknownFormat'
end
-end
\ No newline at end of file
+end
diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb
index 4a994e1e..7a4f47b4 100644
--- a/config/initializers/filter_parameter_logging.rb
+++ b/config/initializers/filter_parameter_logging.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Be sure to restart your server when you modify this file.
# Configure sensitive parameters which will be filtered from the log file.
diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb
index ac033bf9..aa7435fb 100644
--- a/config/initializers/inflections.rb
+++ b/config/initializers/inflections.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format. Inflections
diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb
index d39c83c4..4d8c55ae 100644
--- a/config/initializers/mime_types.rb
+++ b/config/initializers/mime_types.rb
@@ -1,6 +1,8 @@
+# frozen_string_literal: true
+
# Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
# Mime::Type.register_alias "text/html", :iphone
-Mime::Type.register "image/svg+xml", :svg
\ No newline at end of file
+Mime::Type.register 'image/svg+xml', :svg
diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb
index 0e3db2c8..5ac05735 100644
--- a/config/initializers/secret_token.rb
+++ b/config/initializers/secret_token.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Be sure to restart your server when you modify this file.
# Your secret key is used for verifying the integrity of signed cookies.
diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb
index 4fd9a3e7..8feed4ef 100644
--- a/config/initializers/session_store.rb
+++ b/config/initializers/session_store.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Be sure to restart your server when you modify this file.
T4c::Application.config.session_store :cookie_store, key: '_t4c_session'
diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb
index 33725e95..246168a4 100644
--- a/config/initializers/wrap_parameters.rb
+++ b/config/initializers/wrap_parameters.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Be sure to restart your server when you modify this file.
# This file contains settings for ActionController::ParamsWrapper which
diff --git a/config/routes.rb b/config/routes.rb
index 11af549b..03fe0cd4 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,29 +1,30 @@
-T4c::Application.routes.draw do
+# frozen_string_literal: true
+T4c::Application.routes.draw do
root 'home#index'
devise_for :users,
- :controllers => { :omniauth_callbacks => 'users/omniauth_callbacks' }
+ controllers: { omniauth_callbacks: 'users/omniauth_callbacks' }
- get '/users/login' => 'users#login' , :as => 'login_users'
- get '/users/:user_id/tips' => 'tips#index' , :constraints => {:user_id => /\d+/} , :as => 'user_tips'
- get '/users/:nickname/tips' => 'tips#index' , :constraints => {:nickname => /\w[\d\w\-]*/} , :as => 'user_tips_pretty'
- get '/users/:id' => 'users#show' , :constraints => {:id => /\d+/} , :as => 'user'
- get '/users/:nickname' => 'users#show' , :constraints => {:nickname => /\w[\d\w\-]*/} , :as => 'user_pretty'
+ get '/users/login' => 'users#login', :as => 'login_users'
+ get '/users/:user_id/tips' => 'tips#index', :constraints => { user_id: /\d+/ }, :as => 'user_tips'
+ get '/users/:nickname/tips' => 'tips#index', :constraints => { nickname: /\w[\d\w\-]*/ }, :as => 'user_tips_pretty'
+ get '/users/:id' => 'users#show', :constraints => { id: /\d+/ }, :as => 'user'
+ get '/users/:nickname' => 'users#show', :constraints => { nickname: /\w[\d\w\-]*/ }, :as => 'user_pretty'
- get '/projects/:project_id/tips' => 'tips#index' , :constraints => {:project_id => /\d+/} , :as => 'project_tips'
- get '/projects/:project_id/deposits' => 'deposits#index' , :constraints => {:project_id => /\d+/} , :as => 'project_deposits'
- get '/:service/:repo/edit' => 'projects#edit' , :constraints => {:service => /github/ , :repo => /.+/} , :as => 'project_edit_pretty'
- get '/:service/:repo/decide_tip_amounts' => 'projects#decide_tip_amounts' , :constraints => {:service => /github/ , :repo => /.+/} , :as => 'project_decide_tips_pretty'
- get '/:service/:repo/tips' => 'tips#index' , :constraints => {:service => /github/ , :repo => /.+/} , :as => 'project_tips_pretty'
- get '/:service/:repo/deposits' => 'deposits#index' , :constraints => {:service => /github/ , :repo => /.+/} , :as => 'project_deposits_pretty'
- get '/:service/:repo' => 'projects#show' , :constraints => {:service => /github/ , :repo => /.+/} , :as => 'project_pretty'
+ get '/projects/:project_id/tips' => 'tips#index', :constraints => { project_id: /\d+/ }, :as => 'project_tips'
+ get '/projects/:project_id/deposits' => 'deposits#index', :constraints => { project_id: /\d+/ }, :as => 'project_deposits'
+ get '/:service/:repo/edit' => 'projects#edit', :constraints => { service: /github/, repo: /.+/ }, :as => 'project_edit_pretty'
+ get '/:service/:repo/decide_tip_amounts' => 'projects#decide_tip_amounts', :constraints => { service: /github/, repo: /.+/ }, :as => 'project_decide_tips_pretty'
+ get '/:service/:repo/tips' => 'tips#index', :constraints => { service: /github/, repo: /.+/ }, :as => 'project_tips_pretty'
+ get '/:service/:repo/deposits' => 'deposits#index', :constraints => { service: /github/, repo: /.+/ }, :as => 'project_deposits_pretty'
+ get '/:service/:repo' => 'projects#show', :constraints => { service: /github/, repo: /.+/ }, :as => 'project_pretty'
- resources :tips , :only => [:index]
- resources :deposits , :only => [:index]
- resources :withdrawals , :only => [:index]
- resources :users , :only => [:index , :show , :update, :destroy]
- resources :projects , :only => [:index , :show , :update , :edit ] do
+ resources :tips, only: [:index]
+ resources :deposits, only: [:index]
+ resources :withdrawals, only: [:index]
+ resources :users, only: %i[index show update destroy]
+ resources :projects, only: %i[index show update edit] do
collection do
get 'search'
end
diff --git a/db/migrate/20131019133109_devise_create_users.rb b/db/migrate/20131019133109_devise_create_users.rb
index 60dff55e..156e258d 100644
--- a/db/migrate/20131019133109_devise_create_users.rb
+++ b/db/migrate/20131019133109_devise_create_users.rb
@@ -1,9 +1,11 @@
+# frozen_string_literal: true
+
class DeviseCreateUsers < ActiveRecord::Migration[4.2]
def change
create_table(:users) do |t|
## Database authenticatable
- t.string :email, :null => false, :default => ""
- t.string :encrypted_password, :null => false, :default => ""
+ t.string :email, null: false, default: ''
+ t.string :encrypted_password, null: false, default: ''
## Recoverable
t.string :reset_password_token
@@ -13,7 +15,7 @@ def change
t.datetime :remember_created_at
## Trackable
- t.integer :sign_in_count, :default => 0, :null => false
+ t.integer :sign_in_count, default: 0, null: false
t.datetime :current_sign_in_at
t.datetime :last_sign_in_at
t.string :current_sign_in_ip
@@ -30,12 +32,11 @@ def change
# t.string :unlock_token # Only if unlock strategy is :email or :both
# t.datetime :locked_at
-
t.timestamps
end
- add_index :users, :email, :unique => true
- add_index :users, :reset_password_token, :unique => true
+ add_index :users, :email, unique: true
+ add_index :users, :reset_password_token, unique: true
# add_index :users, :confirmation_token, :unique => true
# add_index :users, :unlock_token, :unique => true
end
diff --git a/db/migrate/20131019133235_add_columns_to_users.rb b/db/migrate/20131019133235_add_columns_to_users.rb
index 60257cc0..8e06d45a 100644
--- a/db/migrate/20131019133235_add_columns_to_users.rb
+++ b/db/migrate/20131019133235_add_columns_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddColumnsToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :nickname, :string
diff --git a/db/migrate/20131019144930_add_bitcoin_address_to_users.rb b/db/migrate/20131019144930_add_bitcoin_address_to_users.rb
index c22933ab..5a676e80 100644
--- a/db/migrate/20131019144930_add_bitcoin_address_to_users.rb
+++ b/db/migrate/20131019144930_add_bitcoin_address_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddBitcoinAddressToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :bitcoin_address, :string
diff --git a/db/migrate/20131019164745_create_projects.rb b/db/migrate/20131019164745_create_projects.rb
index 8b682c73..3c06e4eb 100644
--- a/db/migrate/20131019164745_create_projects.rb
+++ b/db/migrate/20131019164745_create_projects.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateProjects < ActiveRecord::Migration[4.2]
def change
create_table :projects do |t|
diff --git a/db/migrate/20131019170122_create_deposits.rb b/db/migrate/20131019170122_create_deposits.rb
index 45db3a76..3c366449 100644
--- a/db/migrate/20131019170122_create_deposits.rb
+++ b/db/migrate/20131019170122_create_deposits.rb
@@ -1,11 +1,13 @@
+# frozen_string_literal: true
+
class CreateDeposits < ActiveRecord::Migration[4.2]
def change
create_table :deposits do |t|
t.references :project, index: true
t.string :txid
t.integer :confirmations
- t.integer :duration, :default => 30.days.to_i
- t.integer :paid_out, :limit => 8
+ t.integer :duration, default: 30.days.to_i
+ t.integer :paid_out, limit: 8
t.datetime :paid_out_at
t.timestamps
diff --git a/db/migrate/20131019170659_create_sendmanies.rb b/db/migrate/20131019170659_create_sendmanies.rb
index cd13b386..22e3799a 100644
--- a/db/migrate/20131019170659_create_sendmanies.rb
+++ b/db/migrate/20131019170659_create_sendmanies.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateSendmanies < ActiveRecord::Migration[4.2]
def change
create_table :sendmanies do |t|
diff --git a/db/migrate/20131019170925_create_tips.rb b/db/migrate/20131019170925_create_tips.rb
index 173ff7fa..6521687e 100644
--- a/db/migrate/20131019170925_create_tips.rb
+++ b/db/migrate/20131019170925_create_tips.rb
@@ -1,9 +1,11 @@
+# frozen_string_literal: true
+
class CreateTips < ActiveRecord::Migration[4.2]
def change
create_table :tips do |t|
t.references :deposit, index: true
t.references :user, index: true
- t.integer :amount, :limit => 8
+ t.integer :amount, limit: 8
t.references :sendmany, index: true
t.boolean :is_refunded
diff --git a/db/migrate/20131019175751_add_some_fields_to_projects.rb b/db/migrate/20131019175751_add_some_fields_to_projects.rb
index 359ed32c..7c28bdb9 100644
--- a/db/migrate/20131019175751_add_some_fields_to_projects.rb
+++ b/db/migrate/20131019175751_add_some_fields_to_projects.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddSomeFieldsToProjects < ActiveRecord::Migration[4.2]
def change
add_column :projects, :name, :string
diff --git a/db/migrate/20131019205025_add_amount_to_deposit.rb b/db/migrate/20131019205025_add_amount_to_deposit.rb
index d4be2067..e0081ee1 100644
--- a/db/migrate/20131019205025_add_amount_to_deposit.rb
+++ b/db/migrate/20131019205025_add_amount_to_deposit.rb
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
class AddAmountToDeposit < ActiveRecord::Migration[4.2]
def change
- add_column :deposits, :amount, :integer, :limit => 8
+ add_column :deposits, :amount, :integer, limit: 8
end
end
diff --git a/db/migrate/20131019211518_add_last_commit_to_projects.rb b/db/migrate/20131019211518_add_last_commit_to_projects.rb
index 749be65d..34fe6f34 100644
--- a/db/migrate/20131019211518_add_last_commit_to_projects.rb
+++ b/db/migrate/20131019211518_add_last_commit_to_projects.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddLastCommitToProjects < ActiveRecord::Migration[4.2]
def change
add_column :projects, :last_commit, :string
diff --git a/db/migrate/20131020003746_add_commit_to_tip.rb b/db/migrate/20131020003746_add_commit_to_tip.rb
index 78823996..f8500ea2 100644
--- a/db/migrate/20131020003746_add_commit_to_tip.rb
+++ b/db/migrate/20131020003746_add_commit_to_tip.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddCommitToTip < ActiveRecord::Migration[4.2]
def change
add_column :tips, :commit, :string
diff --git a/db/migrate/20131020120722_add_login_token_to_users.rb b/db/migrate/20131020120722_add_login_token_to_users.rb
index e3ee6076..dc34d74e 100644
--- a/db/migrate/20131020120722_add_login_token_to_users.rb
+++ b/db/migrate/20131020120722_add_login_token_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddLoginTokenToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :login_token, :string
diff --git a/db/migrate/20131020143021_add_unsubscribed_to_users.rb b/db/migrate/20131020143021_add_unsubscribed_to_users.rb
index fbc4b620..d0d9ab51 100644
--- a/db/migrate/20131020143021_add_unsubscribed_to_users.rb
+++ b/db/migrate/20131020143021_add_unsubscribed_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddUnsubscribedToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :unsubscribed, :boolean
diff --git a/db/migrate/20131020145043_add_notified_at_to_users.rb b/db/migrate/20131020145043_add_notified_at_to_users.rb
index 0a20a915..3ec386bc 100644
--- a/db/migrate/20131020145043_add_notified_at_to_users.rb
+++ b/db/migrate/20131020145043_add_notified_at_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddNotifiedAtToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :notified_at, :datetime
diff --git a/db/migrate/20131030142320_add_project_to_tip.rb b/db/migrate/20131030142320_add_project_to_tip.rb
index ff882711..7615024e 100644
--- a/db/migrate/20131030142320_add_project_to_tip.rb
+++ b/db/migrate/20131030142320_add_project_to_tip.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddProjectToTip < ActiveRecord::Migration[4.2]
def change
add_reference :tips, :project, index: true
diff --git a/db/migrate/20131030142749_drop_deposit_from_tip.rb b/db/migrate/20131030142749_drop_deposit_from_tip.rb
index 3db72501..da281869 100644
--- a/db/migrate/20131030142749_drop_deposit_from_tip.rb
+++ b/db/migrate/20131030142749_drop_deposit_from_tip.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class DropDepositFromTip < ActiveRecord::Migration[4.2]
def change
remove_column :tips, :deposit_id
diff --git a/db/migrate/20131030191346_add_available_amount_cache_to_projects.rb b/db/migrate/20131030191346_add_available_amount_cache_to_projects.rb
index 4ea2248c..3e7e54ba 100644
--- a/db/migrate/20131030191346_add_available_amount_cache_to_projects.rb
+++ b/db/migrate/20131030191346_add_available_amount_cache_to_projects.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddAvailableAmountCacheToProjects < ActiveRecord::Migration[4.2]
def change
add_column :projects, :available_amount_cache, :integer
diff --git a/db/migrate/20131212190037_add_cache_to_users.rb b/db/migrate/20131212190037_add_cache_to_users.rb
index 05b0f2e7..5e47b789 100644
--- a/db/migrate/20131212190037_add_cache_to_users.rb
+++ b/db/migrate/20131212190037_add_cache_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddCacheToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :commits_count, :integer, default: 0
diff --git a/db/migrate/20140102095035_add_refunded_at_to_tips.rb b/db/migrate/20140102095035_add_refunded_at_to_tips.rb
index 1d2a01e8..05d80cb5 100644
--- a/db/migrate/20140102095035_add_refunded_at_to_tips.rb
+++ b/db/migrate/20140102095035_add_refunded_at_to_tips.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddRefundedAtToTips < ActiveRecord::Migration[4.2]
def change
add_column :tips, :refunded_at, :timestamp
diff --git a/db/migrate/20140207061855_add_github_id_to_projects.rb b/db/migrate/20140207061855_add_github_id_to_projects.rb
index 8603e22f..a24ab855 100644
--- a/db/migrate/20140207061855_add_github_id_to_projects.rb
+++ b/db/migrate/20140207061855_add_github_id_to_projects.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddGithubIdToProjects < ActiveRecord::Migration[4.2]
def change
add_column :projects, :github_id, :string
diff --git a/db/migrate/20140209022632_change_projects_description.rb b/db/migrate/20140209022632_change_projects_description.rb
index dd04c317..5cc7d19d 100644
--- a/db/migrate/20140209022632_change_projects_description.rb
+++ b/db/migrate/20140209022632_change_projects_description.rb
@@ -1,7 +1,10 @@
+# frozen_string_literal: true
+
class ChangeProjectsDescription < ActiveRecord::Migration[4.2]
def up
- change_column :projects, :description, :text, :limit => nil
+ change_column :projects, :description, :text, limit: nil
end
+
def down
change_column :projects, :description, :string
end
diff --git a/db/migrate/20140209041123_create_indexes_for_projects.rb b/db/migrate/20140209041123_create_indexes_for_projects.rb
index c17aa464..d51f16bf 100644
--- a/db/migrate/20140209041123_create_indexes_for_projects.rb
+++ b/db/migrate/20140209041123_create_indexes_for_projects.rb
@@ -1,6 +1,8 @@
+# frozen_string_literal: true
+
class CreateIndexesForProjects < ActiveRecord::Migration[4.2]
def change
- add_index :projects, :full_name, :unique => true
- add_index :projects, :github_id, :unique => true
+ add_index :projects, :full_name, unique: true
+ add_index :projects, :github_id, unique: true
end
end
diff --git a/db/migrate/20140223061035_add_project_host.rb b/db/migrate/20140223061035_add_project_host.rb
index 93def914..60fb7f07 100644
--- a/db/migrate/20140223061035_add_project_host.rb
+++ b/db/migrate/20140223061035_add_project_host.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddProjectHost < ActiveRecord::Migration[4.2]
class Project < ActiveRecord::Base
end
diff --git a/db/migrate/20140309192616_create_collaborators.rb b/db/migrate/20140309192616_create_collaborators.rb
index 2aa5ced4..fc2ebd6d 100644
--- a/db/migrate/20140309192616_create_collaborators.rb
+++ b/db/migrate/20140309192616_create_collaborators.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateCollaborators < ActiveRecord::Migration[4.2]
def change
create_table :collaborators do |t|
diff --git a/db/migrate/20140323072851_add_hold_tips_to_project.rb b/db/migrate/20140323072851_add_hold_tips_to_project.rb
index 97063382..cce4571f 100644
--- a/db/migrate/20140323072851_add_hold_tips_to_project.rb
+++ b/db/migrate/20140323072851_add_hold_tips_to_project.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddHoldTipsToProject < ActiveRecord::Migration[4.2]
def change
add_column :projects, :hold_tips, :boolean, default: false
diff --git a/db/migrate/20140323165816_add_commit_message_to_tip.rb b/db/migrate/20140323165816_add_commit_message_to_tip.rb
index 50bc133b..4e33cb1e 100644
--- a/db/migrate/20140323165816_add_commit_message_to_tip.rb
+++ b/db/migrate/20140323165816_add_commit_message_to_tip.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddCommitMessageToTip < ActiveRecord::Migration[4.2]
def change
add_column :tips, :commit_message, :string
diff --git a/db/migrate/20140323173320_create_tipping_policies_texts.rb b/db/migrate/20140323173320_create_tipping_policies_texts.rb
index 1d62f4d1..d6494d3d 100644
--- a/db/migrate/20140323173320_create_tipping_policies_texts.rb
+++ b/db/migrate/20140323173320_create_tipping_policies_texts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateTippingPoliciesTexts < ActiveRecord::Migration[4.2]
def change
create_table :tipping_policies_texts do |t|
diff --git a/db/migrate/20140402032836_change_commit_message_type.rb b/db/migrate/20140402032836_change_commit_message_type.rb
index 9fa48dd3..c610d425 100644
--- a/db/migrate/20140402032836_change_commit_message_type.rb
+++ b/db/migrate/20140402032836_change_commit_message_type.rb
@@ -1,7 +1,10 @@
+# frozen_string_literal: true
+
class ChangeCommitMessageType < ActiveRecord::Migration[4.2]
def up
change_column :tips, :commit_message, :text
end
+
def down
change_column :tips, :commit_message, :string
end
diff --git a/db/migrate/20140402034521_change_commit_message_limit.rb b/db/migrate/20140402034521_change_commit_message_limit.rb
index 61eb8255..6f28baca 100644
--- a/db/migrate/20140402034521_change_commit_message_limit.rb
+++ b/db/migrate/20140402034521_change_commit_message_limit.rb
@@ -1,7 +1,10 @@
+# frozen_string_literal: true
+
class ChangeCommitMessageLimit < ActiveRecord::Migration[4.2]
def up
change_column :tips, :commit_message, :text, limit: nil
end
+
def down
change_column :tips, :commit_message, :text
end
diff --git a/db/migrate/20140402082149_add_fee_size_to_deposits.rb b/db/migrate/20140402082149_add_fee_size_to_deposits.rb
index e137e515..9a4ff742 100644
--- a/db/migrate/20140402082149_add_fee_size_to_deposits.rb
+++ b/db/migrate/20140402082149_add_fee_size_to_deposits.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddFeeSizeToDeposits < ActiveRecord::Migration[4.2]
class Deposit < ActiveRecord::Base
end
@@ -7,7 +9,7 @@ def change
remove_column :deposits, :duration, :integer
reversible do |dir|
# Update all existing deposits
- dir.up { Deposit.update_all(fee_size: CONFIG["our_fee"]) }
+ dir.up { Deposit.update_all(fee_size: CONFIG['our_fee']) }
end
end
end
diff --git a/db/migrate/20140620123610_add_decided_at_to_tips.rb b/db/migrate/20140620123610_add_decided_at_to_tips.rb
index 4ae6c112..544a7b95 100644
--- a/db/migrate/20140620123610_add_decided_at_to_tips.rb
+++ b/db/migrate/20140620123610_add_decided_at_to_tips.rb
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
class AddDecidedAtToTips < ActiveRecord::Migration[4.2]
def change
add_column :tips, :decided_at, :timestamp
end
-end
\ No newline at end of file
+end
diff --git a/db/migrate/20140620124628_update_decided_at_for_existing_tips.rb b/db/migrate/20140620124628_update_decided_at_for_existing_tips.rb
index 974d368a..1d197d3d 100644
--- a/db/migrate/20140620124628_update_decided_at_for_existing_tips.rb
+++ b/db/migrate/20140620124628_update_decided_at_for_existing_tips.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UpdateDecidedAtForExistingTips < ActiveRecord::Migration[4.2]
def up
Tip.where.not(amount: nil).find_each do |tip|
diff --git a/db/migrate/20140717085945_add_info_updated_at_to_projects.rb b/db/migrate/20140717085945_add_info_updated_at_to_projects.rb
index 2da405bb..a90e8bc7 100644
--- a/db/migrate/20140717085945_add_info_updated_at_to_projects.rb
+++ b/db/migrate/20140717085945_add_info_updated_at_to_projects.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddInfoUpdatedAtToProjects < ActiveRecord::Migration[4.2]
def change
add_column :projects, :info_updated_at, :timestamp
diff --git a/db/migrate/20140722092532_add_confirmation_fields_to_users.rb b/db/migrate/20140722092532_add_confirmation_fields_to_users.rb
index c21b8c36..cb9fa533 100644
--- a/db/migrate/20140722092532_add_confirmation_fields_to_users.rb
+++ b/db/migrate/20140722092532_add_confirmation_fields_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddConfirmationFieldsToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :confirmed_at, :timestamp
diff --git a/db/migrate/20140725054216_add_display_name_to_users.rb b/db/migrate/20140725054216_add_display_name_to_users.rb
index 6db1c1c1..0ce6171c 100644
--- a/db/migrate/20140725054216_add_display_name_to_users.rb
+++ b/db/migrate/20140725054216_add_display_name_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddDisplayNameToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :display_name, :string
diff --git a/db/migrate/20140816062159_remove_paid_out_from_deposits.rb b/db/migrate/20140816062159_remove_paid_out_from_deposits.rb
index 409b4c5e..240add45 100644
--- a/db/migrate/20140816062159_remove_paid_out_from_deposits.rb
+++ b/db/migrate/20140816062159_remove_paid_out_from_deposits.rb
@@ -1,6 +1,8 @@
+# frozen_string_literal: true
+
class RemovePaidOutFromDeposits < ActiveRecord::Migration[4.2]
def change
- remove_column :deposits, :paid_out, :integer, :limit => 8
+ remove_column :deposits, :paid_out, :integer, limit: 8
remove_column :deposits, :paid_out_at, :datetime
end
end
diff --git a/db/migrate/20140823035950_add_branch_to_projects.rb b/db/migrate/20140823035950_add_branch_to_projects.rb
index fcc62eda..e149a615 100644
--- a/db/migrate/20140823035950_add_branch_to_projects.rb
+++ b/db/migrate/20140823035950_add_branch_to_projects.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddBranchToProjects < ActiveRecord::Migration[4.2]
def change
add_column :projects, :branch, :string, default: 'master'
diff --git a/db/migrate/20140823060921_make_default_branch_blank.rb b/db/migrate/20140823060921_make_default_branch_blank.rb
index e0bee36f..756b7412 100644
--- a/db/migrate/20140823060921_make_default_branch_blank.rb
+++ b/db/migrate/20140823060921_make_default_branch_blank.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MakeDefaultBranchBlank < ActiveRecord::Migration[4.2]
def change
change_column :projects, :branch, :string, default: nil
diff --git a/db/migrate/20140918051752_add_disable_notifications_to_projects.rb b/db/migrate/20140918051752_add_disable_notifications_to_projects.rb
index 9a8b0e34..3bbdff3c 100644
--- a/db/migrate/20140918051752_add_disable_notifications_to_projects.rb
+++ b/db/migrate/20140918051752_add_disable_notifications_to_projects.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddDisableNotificationsToProjects < ActiveRecord::Migration[4.2]
def change
add_column :projects, :disable_notifications, :boolean
diff --git a/db/migrate/20141029083726_add_avatar_to_projects.rb b/db/migrate/20141029083726_add_avatar_to_projects.rb
index d4d07215..111444fc 100644
--- a/db/migrate/20141029083726_add_avatar_to_projects.rb
+++ b/db/migrate/20141029083726_add_avatar_to_projects.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddAvatarToProjects < ActiveRecord::Migration[4.2]
def change
add_column :projects, :avatar_url, :string
diff --git a/db/migrate/20141112064004_add_deleted_at_to_projects.rb b/db/migrate/20141112064004_add_deleted_at_to_projects.rb
index d930003d..d48360c3 100644
--- a/db/migrate/20141112064004_add_deleted_at_to_projects.rb
+++ b/db/migrate/20141112064004_add_deleted_at_to_projects.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddDeletedAtToProjects < ActiveRecord::Migration[4.2]
def change
add_column :projects, :deleted_at, :timestamp
diff --git a/db/migrate/20150620054216_add_denom.rb b/db/migrate/20150620054216_add_denom.rb
index 6687c650..818cc9c8 100755
--- a/db/migrate/20150620054216_add_denom.rb
+++ b/db/migrate/20150620054216_add_denom.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddDenom < ActiveRecord::Migration[4.2]
def change
add_column :users, :denom, :integer, default: 0
diff --git a/db/migrate/20151219081507_add_bitcoin_address2_to_projects.rb b/db/migrate/20151219081507_add_bitcoin_address2_to_projects.rb
index e9d6bd19..4ac4957d 100644
--- a/db/migrate/20151219081507_add_bitcoin_address2_to_projects.rb
+++ b/db/migrate/20151219081507_add_bitcoin_address2_to_projects.rb
@@ -1,11 +1,11 @@
+# frozen_string_literal: true
+
class AddBitcoinAddress2ToProjects < ActiveRecord::Migration[4.2]
def change
add_column :projects, :bitcoin_address2, :string, index: true
reversible do |dir|
dir.up do
- Project.find_each do |project|
- project.generate_address2
- end
+ Project.find_each(&:generate_address2)
end
end
end
diff --git a/db/migrate/20170308152313_create_wallets.rb b/db/migrate/20170308152313_create_wallets.rb
index 053ede27..360e75e1 100644
--- a/db/migrate/20170308152313_create_wallets.rb
+++ b/db/migrate/20170308152313_create_wallets.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateWallets < ActiveRecord::Migration[4.2]
def change
create_table :wallets do |t|
diff --git a/db/migrate/20170308161814_add_wallet_id_to_projects.rb b/db/migrate/20170308161814_add_wallet_id_to_projects.rb
index 1de39ebc..b7729d45 100644
--- a/db/migrate/20170308161814_add_wallet_id_to_projects.rb
+++ b/db/migrate/20170308161814_add_wallet_id_to_projects.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddWalletIdToProjects < ActiveRecord::Migration[4.2]
def change
add_column :projects, :wallet_id, :integer
diff --git a/db/migrate/20170308163825_add_legacy_addresses_to_projects.rb b/db/migrate/20170308163825_add_legacy_addresses_to_projects.rb
index 98ed4509..42b2bb81 100644
--- a/db/migrate/20170308163825_add_legacy_addresses_to_projects.rb
+++ b/db/migrate/20170308163825_add_legacy_addresses_to_projects.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddLegacyAddressesToProjects < ActiveRecord::Migration[4.2]
def change
add_column :projects, :legacy_address, :string
diff --git a/db/schema.rb b/db/schema.rb
index 3e91d974..02ad5898 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1,4 +1,6 @@
# encoding: UTF-8
+# frozen_string_literal: true
+
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
@@ -12,133 +14,131 @@
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20170308163825) do
-
- create_table "collaborators", force: :cascade do |t|
- t.integer "project_id", limit: 4
- t.string "login", limit: 255
- t.datetime "created_at"
- t.datetime "updated_at"
+ create_table 'collaborators', force: :cascade do |t|
+ t.integer 'project_id', limit: 4
+ t.string 'login', limit: 255
+ t.datetime 'created_at'
+ t.datetime 'updated_at'
end
- add_index "collaborators", ["project_id"], name: "index_collaborators_on_project_id", using: :btree
+ add_index 'collaborators', ['project_id'], name: 'index_collaborators_on_project_id', using: :btree
- create_table "deposits", force: :cascade do |t|
- t.integer "project_id", limit: 4
- t.string "txid", limit: 255
- t.integer "confirmations", limit: 4
- t.datetime "created_at"
- t.datetime "updated_at"
- t.integer "amount", limit: 8
- t.float "fee_size", limit: 24
+ create_table 'deposits', force: :cascade do |t|
+ t.integer 'project_id', limit: 4
+ t.string 'txid', limit: 255
+ t.integer 'confirmations', limit: 4
+ t.datetime 'created_at'
+ t.datetime 'updated_at'
+ t.integer 'amount', limit: 8
+ t.float 'fee_size', limit: 24
end
- add_index "deposits", ["project_id"], name: "index_deposits_on_project_id", using: :btree
-
- create_table "projects", force: :cascade do |t|
- t.string "url", limit: 255
- t.string "bitcoin_address", limit: 255
- t.datetime "created_at"
- t.datetime "updated_at"
- t.string "name", limit: 255
- t.string "full_name", limit: 255
- t.string "source_full_name", limit: 255
- t.text "description", limit: 65535
- t.integer "watchers_count", limit: 4
- t.string "language", limit: 255
- t.string "last_commit", limit: 255
- t.integer "available_amount_cache", limit: 4
- t.string "github_id", limit: 255
- t.string "host", limit: 255, default: "github"
- t.boolean "hold_tips", default: false
- t.datetime "info_updated_at"
- t.string "branch", limit: 255
- t.boolean "disable_notifications"
- t.string "avatar_url", limit: 255
- t.datetime "deleted_at"
- t.string "bitcoin_address2", limit: 255
- t.integer "wallet_id", limit: 4
- t.string "legacy_address", limit: 255
+ add_index 'deposits', ['project_id'], name: 'index_deposits_on_project_id', using: :btree
+
+ create_table 'projects', force: :cascade do |t|
+ t.string 'url', limit: 255
+ t.string 'bitcoin_address', limit: 255
+ t.datetime 'created_at'
+ t.datetime 'updated_at'
+ t.string 'name', limit: 255
+ t.string 'full_name', limit: 255
+ t.string 'source_full_name', limit: 255
+ t.text 'description', limit: 65535
+ t.integer 'watchers_count', limit: 4
+ t.string 'language', limit: 255
+ t.string 'last_commit', limit: 255
+ t.integer 'available_amount_cache', limit: 4
+ t.string 'github_id', limit: 255
+ t.string 'host', limit: 255, default: 'github'
+ t.boolean 'hold_tips', default: false
+ t.datetime 'info_updated_at'
+ t.string 'branch', limit: 255
+ t.boolean 'disable_notifications'
+ t.string 'avatar_url', limit: 255
+ t.datetime 'deleted_at'
+ t.string 'bitcoin_address2', limit: 255
+ t.integer 'wallet_id', limit: 4
+ t.string 'legacy_address', limit: 255
end
- add_index "projects", ["full_name"], name: "index_projects_on_full_name", unique: true, using: :btree
- add_index "projects", ["github_id"], name: "index_projects_on_github_id", unique: true, using: :btree
+ add_index 'projects', ['full_name'], name: 'index_projects_on_full_name', unique: true, using: :btree
+ add_index 'projects', ['github_id'], name: 'index_projects_on_github_id', unique: true, using: :btree
- create_table "sendmanies", force: :cascade do |t|
- t.string "txid", limit: 255
- t.text "data", limit: 65535
- t.string "result", limit: 255
- t.boolean "is_error"
- t.datetime "created_at"
- t.datetime "updated_at"
+ create_table 'sendmanies', force: :cascade do |t|
+ t.string 'txid', limit: 255
+ t.text 'data', limit: 65535
+ t.string 'result', limit: 255
+ t.boolean 'is_error'
+ t.datetime 'created_at'
+ t.datetime 'updated_at'
end
- create_table "tipping_policies_texts", force: :cascade do |t|
- t.integer "project_id", limit: 4
- t.integer "user_id", limit: 4
- t.text "text", limit: 65535
- t.datetime "created_at"
- t.datetime "updated_at"
+ create_table 'tipping_policies_texts', force: :cascade do |t|
+ t.integer 'project_id', limit: 4
+ t.integer 'user_id', limit: 4
+ t.text 'text', limit: 65535
+ t.datetime 'created_at'
+ t.datetime 'updated_at'
end
- add_index "tipping_policies_texts", ["project_id"], name: "index_tipping_policies_texts_on_project_id", using: :btree
- add_index "tipping_policies_texts", ["user_id"], name: "index_tipping_policies_texts_on_user_id", using: :btree
-
- create_table "tips", force: :cascade do |t|
- t.integer "user_id", limit: 4
- t.integer "amount", limit: 8
- t.integer "sendmany_id", limit: 4
- t.datetime "created_at"
- t.datetime "updated_at"
- t.string "commit", limit: 255
- t.integer "project_id", limit: 4
- t.datetime "refunded_at"
- t.text "commit_message", limit: 65535
- t.datetime "decided_at"
+ add_index 'tipping_policies_texts', ['project_id'], name: 'index_tipping_policies_texts_on_project_id', using: :btree
+ add_index 'tipping_policies_texts', ['user_id'], name: 'index_tipping_policies_texts_on_user_id', using: :btree
+
+ create_table 'tips', force: :cascade do |t|
+ t.integer 'user_id', limit: 4
+ t.integer 'amount', limit: 8
+ t.integer 'sendmany_id', limit: 4
+ t.datetime 'created_at'
+ t.datetime 'updated_at'
+ t.string 'commit', limit: 255
+ t.integer 'project_id', limit: 4
+ t.datetime 'refunded_at'
+ t.text 'commit_message', limit: 65535
+ t.datetime 'decided_at'
end
- add_index "tips", ["project_id"], name: "index_tips_on_project_id", using: :btree
- add_index "tips", ["sendmany_id"], name: "index_tips_on_sendmany_id", using: :btree
- add_index "tips", ["user_id"], name: "index_tips_on_user_id", using: :btree
-
- create_table "users", force: :cascade do |t|
- t.string "email", limit: 255, default: "", null: false
- t.string "encrypted_password", limit: 255, default: "", null: false
- t.string "reset_password_token", limit: 255
- t.datetime "reset_password_sent_at"
- t.datetime "remember_created_at"
- t.integer "sign_in_count", limit: 4, default: 0, null: false
- t.datetime "current_sign_in_at"
- t.datetime "last_sign_in_at"
- t.string "current_sign_in_ip", limit: 255
- t.string "last_sign_in_ip", limit: 255
- t.datetime "created_at"
- t.datetime "updated_at"
- t.string "nickname", limit: 255
- t.string "name", limit: 255
- t.string "image", limit: 255
- t.string "bitcoin_address", limit: 255
- t.string "login_token", limit: 255
- t.boolean "unsubscribed"
- t.datetime "notified_at"
- t.integer "commits_count", limit: 4, default: 0
- t.integer "withdrawn_amount", limit: 8, default: 0
- t.datetime "confirmed_at"
- t.datetime "confirmation_sent_at"
- t.string "confirmation_token", limit: 255
- t.string "unconfirmed_email", limit: 255
- t.string "display_name", limit: 255
- t.integer "denom", limit: 4, default: 0
+ add_index 'tips', ['project_id'], name: 'index_tips_on_project_id', using: :btree
+ add_index 'tips', ['sendmany_id'], name: 'index_tips_on_sendmany_id', using: :btree
+ add_index 'tips', ['user_id'], name: 'index_tips_on_user_id', using: :btree
+
+ create_table 'users', force: :cascade do |t|
+ t.string 'email', limit: 255, default: '', null: false
+ t.string 'encrypted_password', limit: 255, default: '', null: false
+ t.string 'reset_password_token', limit: 255
+ t.datetime 'reset_password_sent_at'
+ t.datetime 'remember_created_at'
+ t.integer 'sign_in_count', limit: 4, default: 0, null: false
+ t.datetime 'current_sign_in_at'
+ t.datetime 'last_sign_in_at'
+ t.string 'current_sign_in_ip', limit: 255
+ t.string 'last_sign_in_ip', limit: 255
+ t.datetime 'created_at'
+ t.datetime 'updated_at'
+ t.string 'nickname', limit: 255
+ t.string 'name', limit: 255
+ t.string 'image', limit: 255
+ t.string 'bitcoin_address', limit: 255
+ t.string 'login_token', limit: 255
+ t.boolean 'unsubscribed'
+ t.datetime 'notified_at'
+ t.integer 'commits_count', limit: 4, default: 0
+ t.integer 'withdrawn_amount', limit: 8, default: 0
+ t.datetime 'confirmed_at'
+ t.datetime 'confirmation_sent_at'
+ t.string 'confirmation_token', limit: 255
+ t.string 'unconfirmed_email', limit: 255
+ t.string 'display_name', limit: 255
+ t.integer 'denom', limit: 4, default: 0
end
- add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree
- add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree
+ add_index 'users', ['email'], name: 'index_users_on_email', unique: true, using: :btree
+ add_index 'users', ['reset_password_token'], name: 'index_users_on_reset_password_token', unique: true, using: :btree
- create_table "wallets", force: :cascade do |t|
- t.string "name", limit: 255
- t.string "xpub", limit: 255
- t.integer "last_address_index", limit: 4, default: 1
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ create_table 'wallets', force: :cascade do |t|
+ t.string 'name', limit: 255
+ t.string 'xpub', limit: 255
+ t.integer 'last_address_index', limit: 4, default: 1
+ t.datetime 'created_at', null: false
+ t.datetime 'updated_at', null: false
end
-
end
diff --git a/db/seeds.rb b/db/seeds.rb
index 4edb1e85..c8774b73 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
diff --git a/features/step_definitions/common.rb b/features/step_definitions/common.rb
index 140b071a..07d7f228 100644
--- a/features/step_definitions/common.rb
+++ b/features/step_definitions/common.rb
@@ -1,70 +1,72 @@
+# frozen_string_literal: true
+
Before do
ActionMailer::Base.deliveries.clear
# mock branches method to prevent api call
- Project.any_instance.stub(:branches).and_return(%w(master))
+ Project.any_instance.stub(:branches).and_return(%w[master])
- @default_tip = CONFIG["tip"]
- @default_our_fee = CONFIG["our_fee"]
- @default_min_tip = CONFIG["min_tip"]
+ @default_tip = CONFIG['tip']
+ @default_our_fee = CONFIG['our_fee']
+ @default_min_tip = CONFIG['min_tip']
end
-After do |scenario|
+After do |_scenario|
OmniAuth.config.test_mode = false
- CONFIG["tip"] = @default_tip
- CONFIG["our_fee"] = @default_our_fee
- CONFIG["min_tip"] = @default_min_tip
+ CONFIG['tip'] = @default_tip
+ CONFIG['our_fee'] = @default_our_fee
+ CONFIG['min_tip'] = @default_min_tip
-# Cucumber.wants_to_quit = true if scenario.status.eql? :failed
-# Cucumber.wants_to_quit = true if scenario.status.eql? :undefined
-# Cucumber.wants_to_quit = true if scenario.status.eql? :pending
+ # Cucumber.wants_to_quit = true if scenario.status.eql? :failed
+ # Cucumber.wants_to_quit = true if scenario.status.eql? :undefined
+ # Cucumber.wants_to_quit = true if scenario.status.eql? :pending
end
-def mock_github_user nickname
+def mock_github_user(nickname)
email = "#{nickname.parameterize}@example.com"
OmniAuth.config.test_mode = true
OmniAuth.config.mock_auth[:github] = {
- "info" => {
- "nickname" => nickname ,
- "primary_email" => email ,
- "verified_emails" => [email] ,
- },
+ 'info' => {
+ 'nickname' => nickname,
+ 'primary_email' => email,
+ 'verified_emails' => [email]
+ }
}.to_ostruct
step "a developer named \"#{nickname}\" exists without a bitcoin address"
end
-Given /^a GitHub user named "(.*?)" exists$/ do |nickname|
+Given(/^a GitHub user named "(.*?)" exists$/) do |nickname|
mock_github_user nickname
end
-Given /^I'm signed in as "(.*?)"$/ do |nickname|
+Given(/^I'm signed in as "(.*?)"$/) do |nickname|
mock_github_user nickname
visit root_path
- first(:link, "Sign in").click
- click_on "Sign in with Github"
- page.should have_content("Successfully authenticated")
+ first(:link, 'Sign in').click
+ click_on 'Sign in with Github'
+ page.should have_content('Successfully authenticated')
end
-Given /^I'm not signed in$/ do
+Given(/^I'm not signed in$/) do
visit root_path
- if page.has_content?("Sign out")
- click_on "Sign out"
- page.should have_content("Signed out successfully")
+ if page.has_content?('Sign out')
+ click_on 'Sign out'
+ page.should have_content('Signed out successfully')
else
- page.should have_content("Sign in")
+ page.should have_content('Sign in')
end
OmniAuth.config.test_mode = false
end
-Given (/^I sign in as "(.*?)"$/) { |nickname| step "I'm signed in as \"#{nickname}\"" }
+Given(/^I sign in as "(.*?)"$/) { |nickname| step "I'm signed in as \"#{nickname}\"" }
-Given (/^I sign out$/) { step "I'm not signed in" }
+Given(/^I sign out$/) { step "I'm not signed in" }
-def parse_path_from_page_string page_string
+def parse_path_from_page_string(page_string)
path = nil
# explicit cases
@@ -75,36 +77,36 @@ def parse_path_from_page_string page_string
model = tokens[1]
action = tokens[2] || '' # '' => 'show'
is_user = model.eql? 'user'
- is_project = ['github-project' , 'bitbucket-project'].include? model
+ is_project = %w[github-project bitbucket-project].include? model
if is_project
- projects_paths = ['' , 'edit' , 'decide_tip_amounts' , 'tips' , 'deposits']
+ projects_paths = ['', 'edit', 'decide_tip_amounts', 'tips', 'deposits']
is_valid_path = projects_paths.include? action
service = model.split('-').first
path = "/#{service}/#{name}/#{action}" if is_valid_path
elsif is_user
- user_paths = ['' , 'tips']
+ user_paths = ['', 'tips']
is_valid_path = user_paths.include? action
path = "/users/#{name}/#{action}" if is_valid_path # TODO: nyi
# implicit cases
else case page_string
- when 'home' ; path = root_path ;
- when 'sign_up' ; path = new_user_registration_path ;
- when 'sign_in' ; path = new_user_session_path ;
- when 'users' ; path = users_path ;
- when 'projects' ; path = projects_path ;
- when 'search' ; path = search_projects_path ;
- when 'tips' ; path = tips_path ;
- when 'deposits' ; path = deposits_path ;
- when 'withdrawals' ; path = withdrawals_path ;
- end
+ when 'home' then path = root_path
+ when 'sign_up' then path = new_user_registration_path
+ when 'sign_in' then path = new_user_session_path
+ when 'users' then path = users_path
+ when 'projects' then path = projects_path
+ when 'search' then path = search_projects_path
+ when 'tips' then path = tips_path
+ when 'deposits' then path = deposits_path
+ when 'withdrawals' then path = withdrawals_path
+ end
end
- path || (raise "unknown page")
+ path || (raise 'unknown page')
end
Given(/^I visit the "(.*?)" page$/) do |page_string|
- visit parse_path_from_page_string page_string
+ visit parse_path_from_page_string(page_string)
end
Given(/^I browse to the explicit path "(.*?)"$/) do |url|
@@ -112,18 +114,22 @@ def parse_path_from_page_string page_string
end
Then(/^I should be on the "(.*?)" page$/) do |page_string|
- expected = parse_path_from_page_string page_string rescue expected = page_string
- actual = URI.decode(page.current_path)
+ expected = begin
+ parse_path_from_page_string(page_string)
+ rescue StandardError
+ expected = page_string
+ end
+ actual = URI.decode(page.current_path)
- expected.chop! if (expected.end_with? '/') && (expected.size > 1)
- actual .chop! if (actual .end_with? '/') && (actual .size > 1)
+ expected = expected.chop if (expected.end_with? '/') && (expected.size > 1)
+ actual = actual.chop if (actual.end_with? '/') && (actual.size > 1)
actual.should eq expected
end
-def find_element node_name
+def find_element(node_name)
case node_name
- when "header" ; page.find '.masthead'
+ when 'header' then page.find '.masthead'
end
end
@@ -131,8 +137,8 @@ def find_element node_name
click_on(arg1)
end
-Given(/^I click "(.*?)" within the "(.*?)" area$/) do |link_text , node_name|
- within (find_element node_name) { click_on link_text }
+Given(/^I click "(.*?)" within the "(.*?)" area$/) do |link_text, node_name|
+ within(find_element(node_name)) { click_on link_text }
end
Given(/^I check "(.*?)"$/) do |arg1|
@@ -164,10 +170,10 @@ def find_element node_name
end
When(/^I confirm the email address: "(.*?)"$/) do |email|
- mail = ActionMailer::Base.deliveries.select {|ea| ea.to.first.eql? email}.first
+ mail = ActionMailer::Base.deliveries.select { |ea| ea.to.first.eql? email }.first
mail_body = mail.body.raw_source
token = mail_body.split('?confirmation_token=')[1].split('">Confirm my account').first
visit "/users/confirmation?confirmation_token=#{token}"
end
-Then /^some magic stuff happens in the cloud$/ do ; true ; end ;
+Then(/^some magic stuff happens in the cloud$/) { true }
diff --git a/features/step_definitions/home_steps.rb b/features/step_definitions/home_steps.rb
index ce685958..0ec0493e 100644
--- a/features/step_definitions/home_steps.rb
+++ b/features/step_definitions/home_steps.rb
@@ -1,5 +1,6 @@
+# frozen_string_literal: true
-Then(/^I should (.*)\s*see "(.*?)" in the "(.*?)" area$/) do |should , text , node_name|
+Then(/^I should (.*)\s*see "(.*?)" in the "(.*?)" area$/) do |should, text, node_name|
element = find_element node_name
- element.should ((should.eql? 'not ')? (have_no_content text) : (have_content text))
+ element.should((should.eql? 'not ') ? (have_no_content text) : (have_content text))
end
diff --git a/features/step_definitions/project_steps.rb b/features/step_definitions/project_steps.rb
index 0693a5db..b4e23624 100644
--- a/features/step_definitions/project_steps.rb
+++ b/features/step_definitions/project_steps.rb
@@ -1,13 +1,14 @@
+# frozen_string_literal: true
def github_projects
- [@github_project_1 , @github_project_2 , @github_project_3].compact
+ [@github_project_1, @github_project_2, @github_project_3].compact
end
def bitbucket_projects
- [@bitbucket_project_1 , @bitbucket_project_2 , @bitbucket_project_3].compact
+ [@bitbucket_project_1, @bitbucket_project_2, @bitbucket_project_3].compact
end
-def create_github_project project_name , is_mock_project = true
+def create_github_project(project_name, is_mock_project = true)
# NOTE: when is_mock_project is false the app will actually fetch via network
# this is the old "find or create" GUI functionality
# so obviously the actual repo must exist
@@ -20,37 +21,42 @@ def create_github_project project_name , is_mock_project = true
(@github_project_2.present? && (project_name.eql? @github_project_2.full_name))
raise "duplicate project_name '#{project_name}'"
elsif @github_project_3.present?
- raise "the maximum of three test projects already exist"
+ raise 'the maximum of three test projects already exist'
end
- if is_mock_project
- new_project = Project.create! :full_name => project_name , # e.g. "me/my-project"
- :github_id => Digest::SHA1.hexdigest(project_name) ,
- :bitcoin_address => 'mq4NtnmQoQoPfNWEPbhSvxvncgtGo6L8WY'
- else
- new_project = Project.find_or_create_by_url project_name # e.g. "me/my-project"
- end
-
- unless github_projects.include? new_project
- if @github_project_2.present? ; @github_project_3 = new_project ;
- elsif @github_project_1.present? ; @github_project_2 = new_project ;
- else @github_project_1 = new_project ;
+ new_project = if is_mock_project
+ Project.create!(
+ full_name: project_name, # e.g. "me/my-project"
+ github_id: Digest::SHA1.hexdigest(project_name),
+ bitcoin_address: 'mq4NtnmQoQoPfNWEPbhSvxvncgtGo6L8WY'
+ )
+ else
+ Project.find_or_create_by_url(project_name) # e.g. "me/my-project"
+ end
+
+ unless github_projects.include?(new_project)
+ if @github_project_2.present?
+ @github_project_3 = new_project
+ elsif @github_project_1.present?
+ @github_project_2 = new_project
+ else
+ @github_project_1 = new_project
end
end
new_project
end
-def create_bitbicket_project project_name
- raise "unknown provider" # nyi
+def create_bitbicket_project(_project_name)
+ raise 'unknown provider' # nyi
end
-def find_project service , project_name
- project = Project.where(:host => service , :full_name => project_name).first
+def find_project(service, project_name)
+ project = Project.where(host: service, full_name: project_name).first
project || (raise "Project '#{project_name.inspect}' not found")
end
-Given(/^a "(.*?)" project named "(.*?)" exists$/) do |provider , project_name|
+Given(/^a "(.*?)" project named "(.*?)" exists$/) do |provider, project_name|
# NOTE: project owner will be automatically added as a collaborator
# e.g. "seldon" if project_name == "seldon/a-project"
# @current_project is also assigned in step 'regarding the "..." project named "..."'
@@ -60,14 +66,14 @@ def find_project service , project_name
when 'bitbucket'
@current_project = create_bitbicket_project project_name
when 'real-github'
- @current_project = create_github_project project_name , false
+ @current_project = create_github_project project_name, false
else raise "unknown provider \"#{provider}\""
end
end
-When /^regarding the "(.*?)" project named "(.*?)"$/ do |provider , project_name|
+When(/^regarding the "(.*?)" project named "(.*?)"$/) do |provider, project_name|
# NOTE: @current_project is also assigned in step 'a "..." project named "..." exists'
- @current_project = find_project provider , project_name
+ @current_project = find_project provider, project_name
end
Given(/^the project collaborators are:$/) do |table|
@@ -85,13 +91,13 @@ def find_project service , project_name
end
end
-When /^the project syncs with the remote repo$/ do
+When(/^the project syncs with the remote repo$/) do
# in the real world a project has no information regarding commits
# nor collaborators until the worker thread initially fetches the repo
# so we cache new_commits and collaborators and defer loading to this step
# which is intended to simulate the BitcoinTipper::work method
project_owner_name = (@current_project.full_name.split '/').first
- @new_commits ||= {@current_project.id => Hash.new}
+ @new_commits ||= { @current_project.id => {} }
@collaborators ||= [project_owner_name]
@collaborators << project_owner_name unless @collaborators.include? project_owner_name
@@ -99,8 +105,8 @@ def find_project service , project_name
step 'the project collaborators are loaded'
end
-Then /^there should (.*)\s*be a project avatar image visible$/ do |should|
- avatar_xpath = "//img[contains(@src, \"githubusercontent\")]"
+Then(/^there should (.*)\s*be a project avatar image visible$/) do |should|
+ avatar_xpath = '//img[contains(@src, "githubusercontent")]'
if should.eql? 'not '
page.should_not have_xpath avatar_xpath
else
diff --git a/features/step_definitions/tips_steps.rb b/features/step_definitions/tips_steps.rb
index cedd7673..06211d4a 100644
--- a/features/step_definitions/tips_steps.rb
+++ b/features/step_definitions/tips_steps.rb
@@ -1,31 +1,32 @@
+# frozen_string_literal: true
Given(/^our fee is "(.*?)"$/) do |arg1|
- CONFIG["our_fee"] = arg1.to_f
+ CONFIG['our_fee'] = arg1.to_f
end
Given(/^the tip percentage per commit is "(.*?)"$/) do |arg1|
- CONFIG["tip"] = arg1.to_f
+ CONFIG['tip'] = arg1.to_f
end
Given(/^the minimum tip amount is "(.*?)"$/) do |arg1|
- CONFIG["min_tip"] = arg1.to_f * 1e8
+ CONFIG['min_tip'] = arg1.to_f * 1e8
end
Given(/^a deposit of "(.*?)" is made$/) do |deposit|
Deposit.create!(project: @current_project, amount: deposit.to_d * 1e8, confirmations: 10)
end
-def add_new_commit commit_id , nickname , params = {}
- raise "duplicate commit_id" if (find_new_commit commit_id).present?
+def add_new_commit(commit_id, nickname, params = {})
+ raise 'duplicate commit_id' if (find_new_commit commit_id).present?
defaults = {
sha: commit_id,
commit: {
- message: "Some changes",
+ message: 'Some changes',
author: {
- email: "#{nickname}@example.com",
- },
- },
+ email: "#{nickname}@example.com"
+ }
+ }
}
project_id = @current_project.id
@@ -34,7 +35,7 @@ def add_new_commit commit_id , nickname , params = {}
@new_commits[project_id][commit_id] = defaults.deep_merge params
end
-def find_new_commit commit_id
+def find_new_commit(commit_id)
(@new_commits || {}).each_value do |commits|
return commits[commit_id] unless commits[commit_id].nil?
end
@@ -42,41 +43,41 @@ def find_new_commit commit_id
nil
end
-Given(/^a new commit "([^"]*?)" is made by a developer named "(.*?)"$/) do |commit_id , nickname|
- add_new_commit commit_id , nickname
+Given(/^a new commit "([^"]*?)" is made by a developer named "(.*?)"$/) do |commit_id, nickname|
+ add_new_commit commit_id, nickname
end
-Given(/^(\d+) new commit.? (?:is|are) made by a developer named "(.*?)"$/) do |n_commits , nickname|
+Given(/^(\d+) new commit.? (?:is|are) made by a developer named "(.*?)"$/) do |n_commits, nickname|
n_commits.to_i.times do
- add_new_commit Digest::SHA1.hexdigest(SecureRandom.hex) , nickname
+ add_new_commit Digest::SHA1.hexdigest(SecureRandom.hex), nickname
end
end
Given(/^a new commit "([^"]*?)" is made$/) do |commit_id|
- add_new_commit commit_id , "unknown-user"
+ add_new_commit commit_id, 'unknown-user'
end
Given(/^a new commit "(.*?)" is made with parent "([^"]*?)"$/) do |commit_id, parent_commit_id|
- add_new_commit commit_id , "unknown-user" , parents: [{sha: parent_commit_id}]
+ add_new_commit commit_id, 'unknown-user', parents: [{ sha: parent_commit_id }]
end
-Given(/^a new commit "(.*?)" is made with parent "(.*?)" and "(.*?)"$/) do |commit_id, parentA_commit_id, parentB_commit_id|
- params = { parents: [{sha: parentA_commit_id}, {sha: parentB_commit_id}], commit: {message: "Merge #{parentA_commit_id} and #{parentB_commit_id}"} }
- add_new_commit commit_id , "unknown-user" , params
+Given(/^a new commit "(.*?)" is made with parent "(.*?)" and "(.*?)"$/) do |commit_id, parent_a_commit_id, parent_b_commit_id|
+ params = { parents: [{ sha: parent_a_commit_id }, { sha: parent_b_commit_id }], commit: { message: "Merge #{parent_a_commit_id} and #{parent_b_commit_id}" } }
+ add_new_commit commit_id, 'unknown-user', params
end
-Given(/^the author of commit "(.*?)" is "(.*?)"$/) do |commit_id , nickname|
+Given(/^the author of commit "(.*?)" is "(.*?)"$/) do |commit_id, nickname|
commit = find_new_commit commit_id
- raise "no such commit" if commit.nil?
+ raise 'no such commit' if commit.nil?
- commit.deep_merge!(author: {login: nickname}, commit: {author: {email: "#{nickname}@example.com"}})
+ commit.deep_merge!(author: { login: nickname }, commit: { author: { email: "#{nickname}@example.com" } })
end
-Given(/^the message of commit "(.*?)" is "(.*?)"$/) do |commit_id , commit_msg|
+Given(/^the message of commit "(.*?)" is "(.*?)"$/) do |commit_id, commit_msg|
commit = find_new_commit commit_id
- raise "no such commit" if commit.nil?
+ raise 'no such commit' if commit.nil?
- commit.deep_merge!(commit: {message: commit_msg})
+ commit.deep_merge!(commit: { message: commit_msg })
end
Given(/^the most recent commit is "(.*?)"$/) do |commit_id|
@@ -88,9 +89,9 @@ def find_new_commit commit_id
end
When(/^the new commits are loaded$/) do
- raise "no commits have been assigned" if @new_commits.nil?
+ raise 'no commits have been assigned' if @new_commits.nil?
- [@github_project_1 , @github_project_2 , @github_project_3].each do |project|
+ [@github_project_1, @github_project_2, @github_project_3].each do |project|
next if project.nil?
project.reload
@@ -119,13 +120,13 @@ def find_new_commit commit_id
end
When(/^I choose the amount "(.*?)" on commit "(.*?)"$/) do |arg1, arg2|
- within find(".decide-tip-amounts-table tbody tr", text: arg2) do
+ within find('.decide-tip-amounts-table tbody tr', text: arg2) do
choose arg1
end
end
When(/^I choose the amount "(.*?)" on all commits$/) do |arg1|
- all(".decide-tip-amounts-table tbody tr").each do |tr|
+ all('.decide-tip-amounts-table tbody tr').each do |tr|
within tr do
choose arg1
end
@@ -133,11 +134,11 @@ def find_new_commit commit_id
end
When(/^I send a forged request to enable tip holding on the project$/) do
- page.driver.browser.process_and_follow_redirects(:patch, project_path(@current_project), project: {hold_tips: "1"})
+ page.driver.browser.process_and_follow_redirects(:patch, project_path(@current_project), project: { hold_tips: '1' })
end
Then(/^I should see an access denied$/) do
- page.should have_content("You are not authorized to perform this action!")
+ page.should have_content('You are not authorized to perform this action!')
end
Then(/^the project should not hold tips$/) do
@@ -153,7 +154,7 @@ def find_new_commit commit_id
@current_project.reload.should have_undecided_tips
end
-Given(/^the project has (\d+) undecided tip$/) do |arg1|
+Given(/^the project has (\d+) undecided tip$/) do |_arg1|
@current_project.tips.undecided.each(&:destroy)
create(:undecided_tip, project: @current_project)
@current_project.reload.should have_undecided_tips
@@ -165,33 +166,33 @@ def find_new_commit commit_id
params = {
project: {
tips_attributes: {
- "0" => {
+ '0' => {
id: tip.id,
- amount_percentage: "5",
- },
- },
- },
+ amount_percentage: '5'
+ }
+ }
+ }
}
page.driver.browser.process_and_follow_redirects(:patch, decide_tip_amounts_project_path(@current_project), params)
end
-When(/^I send a forged request to change the percentage of commit "(.*?)" to "(.*?)"$/) do |commit , percentage|
+When(/^I send a forged request to change the percentage of commit "(.*?)" to "(.*?)"$/) do |commit, percentage|
tip = @current_project.tips.detect { |t| t.commit == commit }
tip.should_not be_nil
params = {
project: {
tips_attributes: {
- "0" => {
+ '0' => {
id: tip.id,
- amount_percentage: percentage,
- },
- },
- },
+ amount_percentage: percentage
+ }
+ }
+ }
}
path = decide_tip_amounts_project_path @current_project
- page.driver.browser.process_and_follow_redirects :patch , path , params
+ page.driver.browser.process_and_follow_redirects :patch, path, params
end
Then(/^the project should have (\d+) undecided tips$/) do |arg1|
diff --git a/features/step_definitions/users_steps.rb b/features/step_definitions/users_steps.rb
index 7a32a93b..7984b949 100644
--- a/features/step_definitions/users_steps.rb
+++ b/features/step_definitions/users_steps.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
def create_user(nickname, has_bitcoiin_address)
User.create do |user|
@@ -10,15 +11,15 @@ def create_user(nickname, has_bitcoiin_address)
end
end
-Given /^a developer named "(.*?)" exists (with|without) a bitcoin address$/ do |nickname, with|
+Given(/^a developer named "(.*?)" exists (with|without) a bitcoin address$/) do |nickname, with|
@users ||= {}
@users[nickname] ||= create_user(nickname, with.eql?('with'))
end
-Then /^a developer named "(.*?)" does not exist$/ do |nickname|
+Then(/^a developer named "(.*?)" does not exist$/) do |nickname|
User.where(nickname: nickname).first.should be_nil
end
-Then /^a developer named "(.*?)" exists$/ do |nickname|
+Then(/^a developer named "(.*?)" exists$/) do |nickname|
User.where(nickname: nickname).first.should_not be_nil
end
diff --git a/features/support/big_decimal_inspect.rb b/features/support/big_decimal_inspect.rb
index 97c4d459..b358a69e 100644
--- a/features/support/big_decimal_inspect.rb
+++ b/features/support/big_decimal_inspect.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class BigDecimal
def inspect
""
diff --git a/features/support/env.rb b/features/support/env.rb
index cc01c149..812c293d 100644
--- a/features/support/env.rb
+++ b/features/support/env.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
# It is recommended to regenerate this file in the future when you upgrade to a
# newer version of cucumber-rails. Consider adding your own code to a new file
diff --git a/features/support/factory_bot.rb b/features/support/factory_bot.rb
index 168f5ac1..814501a5 100644
--- a/features/support/factory_bot.rb
+++ b/features/support/factory_bot.rb
@@ -1 +1,3 @@
+# frozen_string_literal: true
+
World(FactoryBot::Syntax::Methods)
diff --git a/features/support/finders.rb b/features/support/finders.rb
index 4d4b59c2..b6c32c62 100644
--- a/features/support/finders.rb
+++ b/features/support/finders.rb
@@ -1,5 +1,7 @@
-def find_project service , project_name
-# TODO: subclass GithubProject , BitbucketProject , etc. (:host becomes :type)
- project = Project.where(:host => service , :full_name => project_name).first
+# frozen_string_literal: true
+
+def find_project(service, project_name)
+ # TODO: subclass GithubProject , BitbucketProject , etc. (:host becomes :type)
+ project = Project.where(host: service, full_name: project_name).first
project or raise "Project '#{project_name.inspect}' not found"
end
diff --git a/features/support/ostruct_slice.rb b/features/support/ostruct_slice.rb
index 70b0fd7e..95e6ac4d 100644
--- a/features/support/ostruct_slice.rb
+++ b/features/support/ostruct_slice.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'ostruct'
class OpenStruct
diff --git a/features/support/rspec_doubles.rb b/features/support/rspec_doubles.rb
index 6476fc19..3f8ef86d 100644
--- a/features/support/rspec_doubles.rb
+++ b/features/support/rspec_doubles.rb
@@ -1 +1,3 @@
+# frozen_string_literal: true
+
require 'cucumber/rspec/doubles'
diff --git a/features/support/to_ostruct.rb b/features/support/to_ostruct.rb
index bbb9cbc8..120bcdd3 100644
--- a/features/support/to_ostruct.rb
+++ b/features/support/to_ostruct.rb
@@ -1,9 +1,11 @@
+# frozen_string_literal: true
+
require 'ostruct'
class Hash
def to_ostruct
o = OpenStruct.new(self)
- each do |k,v|
+ each do |k, v|
o.send(:"#{k}=", v.to_ostruct) if v.respond_to? :to_ostruct
end
o
diff --git a/features/support/vcr_setup.rb b/features/support/vcr_setup.rb
index 1513e025..eb0c3854 100644
--- a/features/support/vcr_setup.rb
+++ b/features/support/vcr_setup.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'vcr'
VCR.configure do |c|
diff --git a/lib/bitcoin_address_validator.rb b/lib/bitcoin_address_validator.rb
index 65caccb2..5b0bbd25 100644
--- a/lib/bitcoin_address_validator.rb
+++ b/lib/bitcoin_address_validator.rb
@@ -1,10 +1,10 @@
+# frozen_string_literal: true
+
require 'digest'
class BitcoinAddressValidator < ActiveModel::EachValidator
def validate_each(record, field, value)
- unless value.blank? || valid_bitcoin_address?(value)
- record.errors[field] << "Bitcoin address is invalid"
- end
+ record.errors[field] << 'Bitcoin address is invalid' unless value.blank? || valid_bitcoin_address?(value)
end
private
@@ -42,7 +42,7 @@ def parse_segwit_address(addr)
}.freeze
def valid_legacy_address?(address)
- if (address =~ /^[a-zA-Z1-9]{33,35}$/) and version = version(address)
+ if (address =~ /^[a-zA-Z1-9]{33,35}$/) && (version = version(address))
if (expected_versions = EXPECTED_VERSIONS[CONFIG['network'].to_sym]).present?
expected_versions.include?(version.ord)
else
@@ -55,7 +55,7 @@ def valid_legacy_address?(address)
def version(address)
decoded = b58_decode(address, 25)
-
+
version = decoded[0, 1]
checksum = decoded[-4, decoded.length]
vh160 = decoded[0, decoded.length - 4]
@@ -68,14 +68,14 @@ def version(address)
def b58_decode(value, length)
long_value = 0
index = 0
- result = ""
+ result = ''
value.reverse.each_char do |c|
- long_value += B58Chars.index(c) * (B58Base ** index)
+ long_value += B58Chars.index(c) * (B58Base**index)
index += 1
end
- while long_value >= 256 do
+ while long_value >= 256
div, mod = long_value.divmod 256
result = mod.chr + result
long_value = div
@@ -83,9 +83,7 @@ def b58_decode(value, length)
result = long_value.chr + result
- if result.length < length
- result = 0.chr * (length - result.length) + result
- end
+ result = 0.chr * (length - result.length) + result if result.length < length
result
end
diff --git a/lib/bitcoin_rpc.rb b/lib/bitcoin_rpc.rb
index 8d427643..c245984a 100644
--- a/lib/bitcoin_rpc.rb
+++ b/lib/bitcoin_rpc.rb
@@ -1,10 +1,11 @@
+# frozen_string_literal: true
+
require 'net/http'
require 'uri'
require 'json'
class BitcoinRPC
-
- def initialize(service_url, batch_mode=false)
+ def initialize(service_url, batch_mode = false)
@service_url = service_url
@uri = URI.parse(service_url)
set_batch_mode(batch_mode)
@@ -15,27 +16,28 @@ def set_batch_mode(m)
end
def method_missing(name, *args)
- if (@batch_mode)
- { 'method' => name, 'params' => args, 'id' => 'jsonrpc', 'jsonrpc' => '2.0' }
+ if @batch_mode
+ { 'method' => name, 'params' => args, 'id' => 'jsonrpc', 'jsonrpc' => '2.0' }
else
- post_body = { 'method' => name, 'params' => args, 'id' => 'jsonrpc'}.to_json
- resp = JSON.parse( http_post_request(post_body) )
+ post_body = { 'method' => name, 'params' => args, 'id' => 'jsonrpc' }.to_json
+ resp = JSON.parse(http_post_request(post_body))
raise JSONRPCError, resp['error'] if resp['error']
+
resp['result']
end
end
def commit(reqs)
post_body = reqs.to_json
- resp = JSON.parse( http_post_request(post_body) )
+ resp = JSON.parse(http_post_request(post_body))
raise JSONRPCError, resp if resp.length != reqs.length
+
resp
end
def http_post_request(post_body)
- RestClient.post( @service_url, post_body, :content_type => :json, :accept => :json ).body
+ RestClient.post(@service_url, post_body, content_type: :json, accept: :json).body
end
class JSONRPCError < RuntimeError; end
-
end
diff --git a/lib/bitcoin_tipper.rb b/lib/bitcoin_tipper.rb
index 80230581..a6883584 100644
--- a/lib/bitcoin_tipper.rb
+++ b/lib/bitcoin_tipper.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class BitcoinTipper
class << self
def work_forever
@@ -46,7 +48,7 @@ def refund_unclaimed_tips
def create_tips
Rails.logger.info 'Traversing projects...'
Project.find_each do |project|
- if project.available_amount > 0
+ if project.available_amount.positive?
Rails.logger.info " Project #{project.id} #{project.full_name}"
project.tip_commits
end
@@ -84,6 +86,7 @@ def calculate_outputs
outputs = {}
User.find_each do |user|
next unless user.ready_for_withdrawal?
+
user.tips.decided.unpaid.each do |tip|
tip.update_attribute :sendmany_id, sendmany.id
outputs[user.bitcoin_address] ||= 0
diff --git a/lib/blacklist.rb b/lib/blacklist.rb
index c1ef8f2c..d30d5a75 100644
--- a/lib/blacklist.rb
+++ b/lib/blacklist.rb
@@ -1,8 +1,10 @@
-require "set"
+# frozen_string_literal: true
+
+require 'set'
class Blacklist
def initialize(urls)
- urls = urls.map {|u| normalize_url(u) }
+ urls = urls.map { |u| normalize_url(u) }
@urls = Set.new(urls)
end
@@ -10,28 +12,27 @@ def initialize(urls)
def include?(url)
url = normalize_url(url)
- if @urls.include?(url)
- return true
- end
+ return true if @urls.include?(url)
# Check for the author path.
# https://github.com/author/*
- url[url.rindex("/")..-1] = "/*"
+ url[url.rindex('/')..-1] = '/*'
@urls.include?(url)
end
private
+
def normalize_url(url)
- url = url.clone
+ url = url.dup
- if !url.start_with?("http://", "https://", "//")
- if !url.start_with?("github.com", "bitbucket.org")
+ unless url.start_with?('http://', 'https://', '//')
+ unless url.start_with?('github.com', 'bitbucket.org')
# Assume it is a shortened "author/project" path and
# default to Github.
- url.prepend("github.com/")
+ url.prepend('github.com/')
end
- url.prepend("https://")
+ url.prepend('https://')
end
uri = URI.parse(url)
diff --git a/lib/tasks/cucumber.rake b/lib/tasks/cucumber.rake
index 9f53ce49..dcf14d1a 100644
--- a/lib/tasks/cucumber.rake
+++ b/lib/tasks/cucumber.rake
@@ -1,65 +1,66 @@
+# frozen_string_literal: true
+
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
# It is recommended to regenerate this file in the future when you upgrade to a
# newer version of cucumber-rails. Consider adding your own code to a new file
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
# files.
+unless ARGV.any? { |a| a =~ /^gems/ } # Don't load anything when running the gems:* tasks
-unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks
-
-vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
-$LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil?
+ vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
+ $LOAD_PATH.unshift("#{File.dirname(vendored_cucumber_bin)}/../lib") unless vendored_cucumber_bin.nil?
-begin
- require 'cucumber/rake/task'
+ begin
+ require 'cucumber/rake/task'
- namespace :cucumber do
- Cucumber::Rake::Task.new({:ok => 'test:prepare'}, 'Run features that should pass') do |t|
- t.binary = vendored_cucumber_bin # If nil, the gem's binary is used.
- t.fork = true # You may get faster startup if you set this to false
- t.profile = 'default'
- end
+ namespace :cucumber do
+ Cucumber::Rake::Task.new({ ok: 'test:prepare' }, 'Run features that should pass') do |t|
+ t.binary = vendored_cucumber_bin # If nil, the gem's binary is used.
+ t.fork = true # You may get faster startup if you set this to false
+ t.profile = 'default'
+ end
- Cucumber::Rake::Task.new({:wip => 'test:prepare'}, 'Run features that are being worked on') do |t|
- t.binary = vendored_cucumber_bin
- t.fork = true # You may get faster startup if you set this to false
- t.profile = 'wip'
- end
+ Cucumber::Rake::Task.new({ wip: 'test:prepare' }, 'Run features that are being worked on') do |t|
+ t.binary = vendored_cucumber_bin
+ t.fork = true # You may get faster startup if you set this to false
+ t.profile = 'wip'
+ end
- Cucumber::Rake::Task.new({:rerun => 'test:prepare'}, 'Record failing features and run only them if any exist') do |t|
- t.binary = vendored_cucumber_bin
- t.fork = true # You may get faster startup if you set this to false
- t.profile = 'rerun'
- end
+ Cucumber::Rake::Task.new({ rerun: 'test:prepare' }, 'Record failing features and run only them if any exist') do |t|
+ t.binary = vendored_cucumber_bin
+ t.fork = true # You may get faster startup if you set this to false
+ t.profile = 'rerun'
+ end
- desc 'Run all features'
- task :all => [:ok, :wip]
+ desc 'Run all features'
+ task all: %i[ok wip]
- task :statsetup do
- require 'rails/code_statistics'
- ::STATS_DIRECTORIES << %w(Cucumber\ features features) if File.exist?('features')
- ::CodeStatistics::TEST_TYPES << "Cucumber features" if File.exist?('features')
+ task :statsetup do
+ require 'rails/code_statistics'
+ ::STATS_DIRECTORIES << %w[Cucumber\ features features] if File.exist?('features')
+ ::CodeStatistics::TEST_TYPES << 'Cucumber features' if File.exist?('features')
+ end
end
- end
- desc 'Alias for cucumber:ok'
- task :cucumber => 'cucumber:ok'
+ desc 'Alias for cucumber:ok'
+ task cucumber: 'cucumber:ok'
- task :default => :cucumber
+ task default: :cucumber
- task :features => :cucumber do
- STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***"
- end
+ task features: :cucumber do
+ warn "*** The 'features' task is deprecated. See rake -T cucumber ***"
+ end
- # In case we don't have the generic Rails test:prepare hook, append a no-op task that we can depend upon.
- task 'test:prepare' do
- end
+ # In case we don't have the generic Rails test:prepare hook, append a no-op task that we can depend upon.
+ task 'test:prepare' do
+ end
- task :stats => 'cucumber:statsetup'
-rescue LoadError
- desc 'cucumber rake task not available (cucumber not installed)'
- task :cucumber do
- abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
+ task stats: 'cucumber:statsetup'
+ rescue LoadError
+ desc 'cucumber rake task not available (cucumber not installed)'
+ task :cucumber do
+ abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
+ end
end
-end
end
diff --git a/script/cucumber b/script/cucumber
index 7fa5c920..eb5e962e 100755
--- a/script/cucumber
+++ b/script/cucumber
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: true
vendored_cucumber_bin = Dir["#{File.dirname(__FILE__)}/../vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
if vendored_cucumber_bin
diff --git a/spec/controllers/deposits_controller_spec.rb b/spec/controllers/deposits_controller_spec.rb
index 57de087c..287e58bf 100644
--- a/spec/controllers/deposits_controller_spec.rb
+++ b/spec/controllers/deposits_controller_spec.rb
@@ -1,18 +1,21 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe DepositsController, type: :controller do
describe "GET 'index'" do
- it "returns http success" do
+ it 'returns http success' do
get 'index'
expect(response).to be_successful
end
end
- describe "routing" do
- it "routes GET / to Deposits#index" do
- expect({ :get => "/deposits" }).to route_to(
- :controller => "deposits" ,
- :action => "index" )
+ describe 'routing' do
+ it 'routes GET / to Deposits#index' do
+ expect({ get: '/deposits' }).to route_to(
+ controller: 'deposits',
+ action: 'index'
+ )
end
end
end
diff --git a/spec/controllers/home_controller_spec.rb b/spec/controllers/home_controller_spec.rb
index 992e139b..8a6b1e79 100644
--- a/spec/controllers/home_controller_spec.rb
+++ b/spec/controllers/home_controller_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe HomeController, type: :controller do
@@ -13,31 +15,35 @@
end
end
- describe "routing" do
- it "routes GET / to Home#index" do
- expect({ :get => "/" }).to route_to(
- :controller => "home" ,
- :action => "index" )
+ describe 'routing' do
+ it 'routes GET / to Home#index' do
+ expect({ get: '/' }).to route_to(
+ controller: 'home',
+ action: 'index'
+ )
end
- it "routes GET /home to Home#index" do
- expect({ :get => "/" }).to route_to(
- :controller => "home" ,
- :action => "index" )
+ it 'routes GET /home to Home#index' do
+ expect({ get: '/' }).to route_to(
+ controller: 'home',
+ action: 'index'
+ )
end
- it "routes GET /users/999999/no-such-path to Home#index" do
- expect({ :get => "/users/999999/no-such-path" }).to route_to(
- :controller => "home" ,
- :action => "index" ,
- :path => "users/999999/no-such-path")
+ it 'routes GET /users/999999/no-such-path to Home#index' do
+ expect({ get: '/users/999999/no-such-path' }).to route_to(
+ controller: 'home',
+ action: 'index',
+ path: 'users/999999/no-such-path'
+ )
end
- it "routes GET /any/non-existent/path to Home#index" do
- expect({ :get => "/any/non-existent/path" }).to route_to(
- :controller => "home" ,
- :action => "index" ,
- :path => "any/non-existent/path")
+ it 'routes GET /any/non-existent/path to Home#index' do
+ expect({ get: '/any/non-existent/path' }).to route_to(
+ controller: 'home',
+ action: 'index',
+ path: 'any/non-existent/path'
+ )
end
end
end
diff --git a/spec/controllers/projects_controller_spec.rb b/spec/controllers/projects_controller_spec.rb
index 3c3b5f59..d7d189f3 100644
--- a/spec/controllers/projects_controller_spec.rb
+++ b/spec/controllers/projects_controller_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe ProjectsController, type: :controller do
@@ -57,17 +59,16 @@
end
end
-=begin TODO: NFG - No route matches {:controller=>"projects", :action=>"update"}
- describe 'PUT #update' do
- it 'returns 200 status code' do
- put :update
- response.should be_success
- end
- end
-=end
+ # TODO: NFG - No route matches {:controller=>"projects", :action=>"update"}
+ # describe 'PUT #update' do
+ # it 'returns 200 status code' do
+ # put :update
+ # response.should be_success
+ # end
+ # end
- shared_context 'accessing_project' do |verb , action|
- let(:a_project) { create :project , :host => 'github' , :full_name => "test/test" }
+ shared_context 'accessing_project' do |verb, action|
+ let(:a_project) { create :project, host: 'github', full_name: 'test/test' }
context 'existing_project' do
it 'via project id returns 302 status code' do
@@ -85,7 +86,7 @@
when :get
get(action, params: { service: 'github', repo: a_project.full_name })
when :patch
- patch(action, params: { service: 'github', repo: a_project.full_name})
+ patch(action, params: { service: 'github', repo: a_project.full_name })
end
expect(response).to be_successful
end
@@ -95,9 +96,9 @@
it 'via project id returns 302 status code' do
case verb
when :get
- get(action, params: { id: 999999 })
+ get(action, params: { id: 999_999 })
when :patch
- patch(action, params: { id: 999999 })
+ patch(action, params: { id: 999_999 })
end
expect(response).to be_redirect
end
@@ -115,11 +116,11 @@
end
describe 'GET #show' do
- include_context 'accessing_project' , :get , :show
+ include_context 'accessing_project', :get, :show
context 'with existing repo that has been blacklisted' do
- let(:blacklisted_repo) { create(:project, host: "github", full_name: "mitsuhiko/flask") }
- let(:subject) { get(:show, params: { service: "github", repo: blacklisted_repo.full_name }) }
+ let(:blacklisted_repo) { create(:project, host: 'github', full_name: 'mitsuhiko/flask') }
+ let(:subject) { get(:show, params: { service: 'github', repo: blacklisted_repo.full_name }) }
it 'renders blacklisted template' do
expect(subject).to render_template :blacklisted
@@ -129,17 +130,17 @@
describe 'GET #edit' do
it 'returns 302 status code' do
-# TODO: requires logged in user who is project collaborator
-# include_context 'accessing_project' , :get , :edit
+ # TODO: requires logged in user who is project collaborator
+ # include_context 'accessing_project' , :get , :edit
- get(:edit, params: { service: 'github' , repo: 'test/test' })
+ get(:edit, params: { service: 'github', repo: 'test/test' })
expect(response).to be_redirect
end
end
describe 'GET #decide_tip_amounts' do
-# TODO: requires logged in user who is project collaborator and some tips
-# include_context 'accessing_project' , :get , :decide_tip_amounts
+ # TODO: requires logged in user who is project collaborator and some tips
+ # include_context 'accessing_project' , :get , :decide_tip_amounts
it 'returns 302 status code' do
get(:decide_tip_amounts, params: { service: 'github', repo: 'test/test' })
@@ -148,119 +149,133 @@
end
describe 'PATCH #decide_tip_amounts' do
-# TODO: requires logged in user who is project collaborator and some tips
-# include_context 'accessing_project' , :patch , :decide_tip_amounts
+ # TODO: requires logged in user who is project collaborator and some tips
+ # include_context 'accessing_project' , :patch , :decide_tip_amounts
it 'returns 302 status code' do
- patch(:decide_tip_amounts, params: { service: 'github' , repo: 'test/test' })
+ patch(:decide_tip_amounts, params: { service: 'github', repo: 'test/test' })
expect(response).to be_redirect
end
end
- describe "routing" do
- it "routes GET /projects to Project#index" do
- expect({ :get => "/projects" }).to route_to(
- :controller => "projects" ,
- :action => "index" )
+ describe 'routing' do
+ it 'routes GET /projects to Project#index' do
+ expect({ get: '/projects' }).to route_to(
+ controller: 'projects',
+ action: 'index'
+ )
end
- it "routes GET /projects/search?query= to Project#search" do
- expect({ :get => "/projects/search?query=seldon&order=balance" }).to route_to(
- :controller => "projects" ,
- :action => "search" ,
- :query => "seldon" ,
- :order => "balance" )
+ it 'routes GET /projects/search?query= to Project#search' do
+ expect({ get: '/projects/search?query=seldon&order=balance' }).to route_to(
+ controller: 'projects',
+ action: 'search',
+ query: 'seldon',
+ order: 'balance'
+ )
end
- it "routes GET /projects/1 to Project#show" do
- expect({ :get => "/projects/1" }).to route_to(
- :controller => "projects" ,
- :action => "show" ,
- :id => "1" )
+ it 'routes GET /projects/1 to Project#show' do
+ expect({ get: '/projects/1' }).to route_to(
+ controller: 'projects',
+ action: 'show',
+ id: '1'
+ )
end
- it "routes GET /projects/1/edit to Project#edit" do
- expect({ :get => "/projects/1/edit" }).to route_to(
- :controller => "projects" ,
- :action => "edit" ,
- :id => "1" )
+ it 'routes GET /projects/1/edit to Project#edit' do
+ expect({ get: '/projects/1/edit' }).to route_to(
+ controller: 'projects',
+ action: 'edit',
+ id: '1'
+ )
end
- it "routes PUT /projects/1 to Project#update" do
- expect({ :put => "/projects/1" }).to route_to(
- :controller => "projects" ,
- :action => "update" ,
- :id => "1" )
+ it 'routes PUT /projects/1 to Project#update' do
+ expect({ put: '/projects/1' }).to route_to(
+ controller: 'projects',
+ action: 'update',
+ id: '1'
+ )
end
- it "routes GET /projects/1/decide_tip_amounts to Project#decide_tip_amounts" do
- expect({ :get => "/projects/1/decide_tip_amounts" }).to route_to(
- :controller => "projects" ,
- :action => "decide_tip_amounts" ,
- :id => "1" )
+ it 'routes GET /projects/1/decide_tip_amounts to Project#decide_tip_amounts' do
+ expect({ get: '/projects/1/decide_tip_amounts' }).to route_to(
+ controller: 'projects',
+ action: 'decide_tip_amounts',
+ id: '1'
+ )
end
- it "routes PATCH /projects/1/decide_tip_amounts to Project#decide_tip_amounts" do
- expect({ :patch => "/projects/1/decide_tip_amounts" }).to route_to(
- :controller => "projects" ,
- :action => "decide_tip_amounts" ,
- :id => "1" )
+ it 'routes PATCH /projects/1/decide_tip_amounts to Project#decide_tip_amounts' do
+ expect({ patch: '/projects/1/decide_tip_amounts' }).to route_to(
+ controller: 'projects',
+ action: 'decide_tip_amounts',
+ id: '1'
+ )
end
- it "routes GET /projects/1/tips to Tips#index" do
- expect({ :get => "/projects/1/tips" }).to route_to(
- :controller => "tips" ,
- :action => "index" ,
- :project_id => "1" )
+ it 'routes GET /projects/1/tips to Tips#index' do
+ expect({ get: '/projects/1/tips' }).to route_to(
+ controller: 'tips',
+ action: 'index',
+ project_id: '1'
+ )
end
- it "routes GET /projects/1/deposits to Deposits#index" do
- expect({ :get => "/projects/1/deposits" }).to route_to(
- :controller => "deposits" ,
- :action => "index" ,
- :project_id => "1" )
+ it 'routes GET /projects/1/deposits to Deposits#index' do
+ expect({ get: '/projects/1/deposits' }).to route_to(
+ controller: 'deposits',
+ action: 'index',
+ project_id: '1'
+ )
end
end
- describe "Project pretty url routing" do
- it "routes GET /:provider/:repo to Project#show" do
- expect({ :get => "/github/test/test" }).to route_to(
- :controller => "projects" ,
- :action => "show" ,
- :service => "github" ,
- :repo => "test/test")
+ describe 'Project pretty url routing' do
+ it 'routes GET /:provider/:repo to Project#show' do
+ expect({ get: '/github/test/test' }).to route_to(
+ controller: 'projects',
+ action: 'show',
+ service: 'github',
+ repo: 'test/test'
+ )
end
- it "routes GET /:provider/:repo/edit to Project#edit" do
- expect({ :get => "/github/test/test/edit" }).to route_to(
- :controller => "projects" ,
- :action => "edit" ,
- :service => "github" ,
- :repo => "test/test")
+ it 'routes GET /:provider/:repo/edit to Project#edit' do
+ expect({ get: '/github/test/test/edit' }).to route_to(
+ controller: 'projects',
+ action: 'edit',
+ service: 'github',
+ repo: 'test/test'
+ )
end
- it "routes GET /:provider/:repo/decide_tip_amounts to Project#decide_tip_amounts" do
- expect({ :get => "/github/test/test/decide_tip_amounts" }).to route_to(
- :controller => "projects" ,
- :action => "decide_tip_amounts" ,
- :service => "github" ,
- :repo => "test/test" )
+ it 'routes GET /:provider/:repo/decide_tip_amounts to Project#decide_tip_amounts' do
+ expect({ get: '/github/test/test/decide_tip_amounts' }).to route_to(
+ controller: 'projects',
+ action: 'decide_tip_amounts',
+ service: 'github',
+ repo: 'test/test'
+ )
end
- it "routes GET /:provider/:repo/tips to Project#tips" do
- expect({ :get => "/github/test/test/tips" }).to route_to(
- :controller => "tips" ,
- :action => "index" ,
- :service => "github" ,
- :repo => "test/test")
+ it 'routes GET /:provider/:repo/tips to Project#tips' do
+ expect({ get: '/github/test/test/tips' }).to route_to(
+ controller: 'tips',
+ action: 'index',
+ service: 'github',
+ repo: 'test/test'
+ )
end
- it "routes GET /:provider/:repo/deposits to Project#deposits" do
- expect({ :get => "/github/test/test/deposits" }).to route_to(
- :controller => "deposits" ,
- :action => "index" ,
- :service => "github" ,
- :repo => "test/test")
+ it 'routes GET /:provider/:repo/deposits to Project#deposits' do
+ expect({ get: '/github/test/test/deposits' }).to route_to(
+ controller: 'deposits',
+ action: 'index',
+ service: 'github',
+ repo: 'test/test'
+ )
end
end
end
diff --git a/spec/controllers/tips_controller_spec.rb b/spec/controllers/tips_controller_spec.rb
index 60385bcb..d060ccf2 100644
--- a/spec/controllers/tips_controller_spec.rb
+++ b/spec/controllers/tips_controller_spec.rb
@@ -1,18 +1,21 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe TipsController, type: :controller do
describe "GET 'index'" do
- it "returns http success" do
+ it 'returns http success' do
get 'index'
expect(response).to be_successful
end
end
- describe "routing" do
- it "routes GET / to Tips#index" do
- expect({ :get => "/tips" }).to route_to(
- :controller => "tips" ,
- :action => "index" )
+ describe 'routing' do
+ it 'routes GET / to Tips#index' do
+ expect({ get: '/tips' }).to route_to(
+ controller: 'tips',
+ action: 'index'
+ )
end
end
end
diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb
index a33c9f14..70b6cb2d 100644
--- a/spec/controllers/users_controller_spec.rb
+++ b/spec/controllers/users_controller_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe UsersController, type: :controller do
@@ -93,61 +95,67 @@
end
end
- describe "routing" do
- it "routes GET /users to User#index" do
- expect({ :get => "/users" }).to route_to(
- :controller => "users" ,
- :action => "index" )
+ describe 'routing' do
+ it 'routes GET /users to User#index' do
+ expect({ get: '/users' }).to route_to(
+ controller: 'users',
+ action: 'index'
+ )
end
- it "routes GET /users/nick-name321 to User#show" do
- expect({ :get => "/users/nick-name321" }).to route_to(
- :controller => "users" ,
- :action => "show" ,
- :nickname => "nick-name321" )
+ it 'routes GET /users/nick-name321 to User#show' do
+ expect({ get: '/users/nick-name321' }).to route_to(
+ controller: 'users',
+ action: 'show',
+ nickname: 'nick-name321'
+ )
end
- it "routes GET /users/login to User#login" do
- expect({ :get => "/users/login" }).to route_to(
- :controller => "users" ,
- :action => "login" )
+ it 'routes GET /users/login to User#login' do
+ expect({ get: '/users/login' }).to route_to(
+ controller: 'users',
+ action: 'login'
+ )
end
- it "routes GET /users/1/tips to Tips#index" do
- expect({ :get => "/users/1/tips" }).to route_to(
- :controller => "tips" ,
- :action => "index" ,
- :user_id => "1" )
+ it 'routes GET /users/1/tips to Tips#index' do
+ expect({ get: '/users/1/tips' }).to route_to(
+ controller: 'tips',
+ action: 'index',
+ user_id: '1'
+ )
end
end
- describe "pretty url routing" do
+ describe 'pretty url routing' do
let(:user) { create(:user) }
- it "regex rejects reserved user paths" do
+ it 'regex rejects reserved user paths' do
# accepted pertty url usernames
- should_accept = [' ' , 'logi' , 'ogin' , 's4c2' , '42x' , 'nick name' , 'kd']
+ should_accept = [' ', 'logi', 'ogin', 's4c2', '42x', 'nick name', 'kd']
# reserved routes (rejected pertty url usernames)
- should_reject = ['' , '1' , '42']
+ should_reject = ['', '1', '42']
- accepted = should_accept.select {|ea| ea =~ /\D+/}
- rejected = should_reject.select {|ea| (ea =~ /\D+/).nil? }
+ accepted = should_accept.select { |ea| ea =~ /\D+/ }
+ rejected = should_reject.select { |ea| (ea =~ /\D+/).nil? }
(expect(accepted.size).to eq(should_accept.size)) &&
- (expect(rejected.size).to eq(should_reject.size))
+ (expect(rejected.size).to eq(should_reject.size))
end
- it "routes GET /users/:nickname to User#show" do
- expect({ :get => "/users/#{user.nickname}" }).to route_to(
- :controller => "users" ,
- :action => "show" ,
- :nickname => "kd" )
+ it 'routes GET /users/:nickname to User#show' do
+ expect({ get: "/users/#{user.nickname}" }).to route_to(
+ controller: 'users',
+ action: 'show',
+ nickname: 'kd'
+ )
end
- it "routes GET /users/:nickname/tips to Tips#index" do
- expect({ :get => "/users/#{user.nickname}/tips" }).to route_to(
- :controller => "tips" ,
- :action => "index" ,
- :nickname => "kd" )
+ it 'routes GET /users/:nickname/tips to Tips#index' do
+ expect({ get: "/users/#{user.nickname}/tips" }).to route_to(
+ controller: 'tips',
+ action: 'index',
+ nickname: 'kd'
+ )
end
end
end
diff --git a/spec/controllers/withdrawals_controller_spec.rb b/spec/controllers/withdrawals_controller_spec.rb
index 1e1cab44..d1db2351 100644
--- a/spec/controllers/withdrawals_controller_spec.rb
+++ b/spec/controllers/withdrawals_controller_spec.rb
@@ -1,18 +1,21 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe WithdrawalsController, type: :controller do
describe "GET 'index'" do
- it "returns http success" do
+ it 'returns http success' do
get 'index'
expect(response).to be_successful
end
end
- describe "routing" do
- it "routes GET / to Withdrawals#index" do
- expect({ :get => "/withdrawals" }).to route_to(
- :controller => "withdrawals" ,
- :action => "index" )
+ describe 'routing' do
+ it 'routes GET / to Withdrawals#index' do
+ expect({ get: '/withdrawals' }).to route_to(
+ controller: 'withdrawals',
+ action: 'index'
+ )
end
end
end
diff --git a/spec/factories/deposit.rb b/spec/factories/deposit.rb
index 6b30af0f..9c1bb01a 100644
--- a/spec/factories/deposit.rb
+++ b/spec/factories/deposit.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
FactoryBot.define do
factory :deposit do
association(:project)
diff --git a/spec/factories/project.rb b/spec/factories/project.rb
index 4e77733d..a65af666 100644
--- a/spec/factories/project.rb
+++ b/spec/factories/project.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
FactoryBot.define do
factory :project do
url { 'MyString' }
diff --git a/spec/factories/sendmany.rb b/spec/factories/sendmany.rb
index 4d782279..53a1823a 100644
--- a/spec/factories/sendmany.rb
+++ b/spec/factories/sendmany.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
FactoryBot.define do
factory :sendmany do
txid { 'txid' }
diff --git a/spec/factories/tip.rb b/spec/factories/tip.rb
index e7877b9e..4148ec5d 100644
--- a/spec/factories/tip.rb
+++ b/spec/factories/tip.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
FactoryBot.define do
factory :tip do
association(:user)
diff --git a/spec/factories/user.rb b/spec/factories/user.rb
index 0fb99524..3c639b89 100644
--- a/spec/factories/user.rb
+++ b/spec/factories/user.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
FactoryBot.define do
factory :user do
sequence(:email) { |n| "test#{n}@gmail.com" }
diff --git a/spec/factories/wallets.rb b/spec/factories/wallets.rb
index f47103bd..9c2f74d9 100644
--- a/spec/factories/wallets.rb
+++ b/spec/factories/wallets.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
FactoryBot.define do
factory :wallet do
name { 'test wallet' }
diff --git a/spec/lib/blacklist_spec.rb b/spec/lib/blacklist_spec.rb
index 08ab8d61..78c7e693 100644
--- a/spec/lib/blacklist_spec.rb
+++ b/spec/lib/blacklist_spec.rb
@@ -1,29 +1,31 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe Blacklist do
it 'handles blacklisted URLs' do
urls = [
- "https://github.com/author/notips",
- "https://bitbucket.org/author/notips",
- "https://github.com/notips/*",
- "https://bitbucket.org/notips/*",
+ 'https://github.com/author/notips',
+ 'https://bitbucket.org/author/notips',
+ 'https://github.com/notips/*',
+ 'https://bitbucket.org/notips/*'
]
list = Blacklist.new(urls)
# Blacklisted projects.
- expect(list.include?("https://github.com/author/notips")).to eq(true)
- expect(list.include?("http://github.com/author/notips?tips=true")).to eq(true)
- expect(list.include?("https://bitbucket.org/author/notips")).to eq(true)
- expect(list.include?("github.com/author/notips")).to eq(true)
- expect(list.include?("author/notips")).to eq(true)
+ expect(list.include?('https://github.com/author/notips')).to eq(true)
+ expect(list.include?('http://github.com/author/notips?tips=true')).to eq(true)
+ expect(list.include?('https://bitbucket.org/author/notips')).to eq(true)
+ expect(list.include?('github.com/author/notips')).to eq(true)
+ expect(list.include?('author/notips')).to eq(true)
# Non-blacklisted projects.
- expect(list.include?("https://github.com/author/tipme")).to eq(false)
- expect(list.include?("https://bitbucket.org/author/tipme")).to eq(false)
+ expect(list.include?('https://github.com/author/tipme')).to eq(false)
+ expect(list.include?('https://bitbucket.org/author/tipme')).to eq(false)
# Blacklisted authors.
- expect(list.include?("https://github.com/notips/tipme")).to eq(true)
- expect(list.include?("https://bitbucket.org/notips/tipme")).to eq(true)
+ expect(list.include?('https://github.com/notips/tipme')).to eq(true)
+ expect(list.include?('https://bitbucket.org/notips/tipme')).to eq(true)
end
end
diff --git a/spec/mailers/user_mailer_spec.rb b/spec/mailers/user_mailer_spec.rb
index efe05a40..db1338d0 100644
--- a/spec/mailers/user_mailer_spec.rb
+++ b/spec/mailers/user_mailer_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe UserMailer do
diff --git a/spec/misc_spec.rb b/spec/misc_spec.rb
index 70fa333b..e8ff2b0e 100644
--- a/spec/misc_spec.rb
+++ b/spec/misc_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'Misc tets' do
@@ -6,7 +8,7 @@
it 'has a flag image for each locale' do
locales.each do |locale|
path = File.join(Rails.root, 'app', 'assets', 'images', 'flags', "#{locale}.png")
- expect(File.exists?(path)).to be_truthy, "#{locale} flag is missing"
+ expect(File.exist?(path)).to be_truthy, "#{locale} flag is missing"
end
end
end
diff --git a/spec/models/collaborator_spec.rb b/spec/models/collaborator_spec.rb
index 43f31cee..2fe276c8 100644
--- a/spec/models/collaborator_spec.rb
+++ b/spec/models/collaborator_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe Collaborator, type: :model do
diff --git a/spec/models/deposit_spec.rb b/spec/models/deposit_spec.rb
index cd5781e7..6456520e 100644
--- a/spec/models/deposit_spec.rb
+++ b/spec/models/deposit_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe Deposit, type: :model do
@@ -29,11 +31,10 @@
private
def with_custom_fee
- old_fee = CONFIG["our_fee"]
- CONFIG["our_fee"] = 0.01
+ old_fee = CONFIG['our_fee']
+ CONFIG['our_fee'] = 0.01
yield
ensure
- CONFIG["our_fee"] = old_fee
+ CONFIG['our_fee'] = old_fee
end
-
end
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index 91fa9a10..d72bcd79 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe Project, type: :model do
@@ -16,7 +18,7 @@
it { should validate_presence_of(:host) }
it { should validate_uniqueness_of(:full_name) }
it { should validate_uniqueness_of(:github_id) }
- it { should validate_inclusion_of(:host).in_array %w(github bitbucket) }
+ it { should validate_inclusion_of(:host).in_array %w[github bitbucket] }
end
describe 'bitcoin_address' do
diff --git a/spec/models/send_many_spec.rb b/spec/models/send_many_spec.rb
index 7fdcf6c7..4f1c3435 100644
--- a/spec/models/send_many_spec.rb
+++ b/spec/models/send_many_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe Sendmany, type: :model do
diff --git a/spec/models/sendmany_spec.rb b/spec/models/sendmany_spec.rb
index 7fdcf6c7..4f1c3435 100644
--- a/spec/models/sendmany_spec.rb
+++ b/spec/models/sendmany_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe Sendmany, type: :model do
diff --git a/spec/models/tip_spec.rb b/spec/models/tip_spec.rb
index e307006c..3bd46d4c 100644
--- a/spec/models/tip_spec.rb
+++ b/spec/models/tip_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe Tip, type: :model do
diff --git a/spec/models/tipping_policies_text_spec.rb b/spec/models/tipping_policies_text_spec.rb
index c9f98398..869a51c2 100644
--- a/spec/models/tipping_policies_text_spec.rb
+++ b/spec/models/tipping_policies_text_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe TippingPoliciesText, type: :model do
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index 1381b14e..677edf84 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe User, type: :model do
diff --git a/spec/models/wallet_spec.rb b/spec/models/wallet_spec.rb
index c48d5118..c7ebeab9 100644
--- a/spec/models/wallet_spec.rb
+++ b/spec/models/wallet_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe Wallet, type: :model do
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index d3706ea5..9231f65f 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,11 +1,13 @@
-require "minitest/spec"
+# frozen_string_literal: true
+
+require 'minitest/spec'
require 'simplecov'
SimpleCov.start 'rails'
# This file is copied to spec/ when you run 'rails generate rspec:install'
-ENV["RAILS_ENV"] ||= 'test'
-require File.expand_path("../../config/environment", __FILE__)
+ENV['RAILS_ENV'] ||= 'test'
+require File.expand_path('../config/environment', __dir__)
require 'rspec/rails'
#
# Requires supporting ruby files with custom matchers and macros, etc, in
@@ -15,7 +17,7 @@
# run twice. It is recommended that you do not name files matching this glob to
# end with _spec.rb. You can configure this pattern with with the --pattern
# option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
-Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
+Dir[Rails.root.join('spec/support/**/*.rb')].sort.each { |f| require f }
# Checks for pending migrations before tests are run.
# If you are not using ActiveRecord, you can remove this line.
@@ -53,7 +55,7 @@
# order dependency and want to debug it, you can fix the order by providing
# the seed, which is printed after each run.
# --seed 1234
- config.order = "random"
+ config.order = 'random'
include FactoryBot::Syntax::Methods
config.include Devise::Test::ControllerHelpers, type: :controller
diff --git a/spec/support/controller_macros.rb b/spec/support/controller_macros.rb
index d1cf5212..a29d39aa 100644
--- a/spec/support/controller_macros.rb
+++ b/spec/support/controller_macros.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module ControllerMacros
def login_user
before do
From 03287b253abce3ea7eba28fb135d35920d346771 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 22 Nov 2020 12:49:24 +0100
Subject: [PATCH 068/159] fixed undefined constant error
---
app/models/project.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/models/project.rb b/app/models/project.rb
index e7380418..a984c67d 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -103,7 +103,7 @@ def new_commits
reverse
end
rescue Octokit::BadGateway, Octokit::NotFound, Octokit::InternalServerError, Octokit::Forbidden,
- Errno::ETIMEDOUT, Net::ReadTimeout, Faraday::Error::ConnectionFailed => e
+ Errno::ETIMEDOUT, Net::ReadTimeout, Faraday::ConnectionFailed => e
Rails.logger.info "Project ##{id}: #{e.class} happened"
rescue StandardError => e
Airbrake.notify(e)
From 9b6a0d86a5d301a66748766bb2dbae6dbf2870bf Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 22 Nov 2020 12:59:23 +0100
Subject: [PATCH 069/159] binstubs
---
.rubocop.yml | 1 +
bin/bundle | 114 +++++++++++++++++++++++++++++++++++
bin/cap | 29 +++++++++
bin/capify | 29 +++++++++
bin/cucumber | 29 +++++++++
bin/cucumber-tag-expressions | 29 +++++++++
bin/erubis | 29 +++++++++
bin/gherkin | 29 +++++++++
bin/gherkin-ruby | 29 +++++++++
bin/haml | 29 +++++++++
bin/html2haml | 29 +++++++++
bin/htmldiff | 29 +++++++++
bin/ldiff | 29 +++++++++
bin/lessc | 29 +++++++++
bin/nokogiri | 29 +++++++++
bin/rackup | 29 +++++++++
bin/rails | 29 +++++++++
bin/rake | 29 +++++++++
bin/rdoc | 29 +++++++++
bin/restclient | 29 +++++++++
bin/ri | 29 +++++++++
bin/rspec | 29 +++++++++
bin/rubocop | 29 +++++++++
bin/ruby-parse | 29 +++++++++
bin/ruby-rewrite | 29 +++++++++
bin/ruby_parse | 29 +++++++++
bin/ruby_parse_extract_error | 29 +++++++++
bin/sdoc | 29 +++++++++
bin/sdoc-merge | 29 +++++++++
bin/sidekiq | 29 +++++++++
bin/sidekiqmon | 29 +++++++++
bin/sprockets | 29 +++++++++
bin/thor | 29 +++++++++
bin/tilt | 29 +++++++++
34 files changed, 1043 insertions(+)
create mode 100755 bin/bundle
create mode 100755 bin/cap
create mode 100755 bin/capify
create mode 100755 bin/cucumber
create mode 100755 bin/cucumber-tag-expressions
create mode 100755 bin/erubis
create mode 100755 bin/gherkin
create mode 100755 bin/gherkin-ruby
create mode 100755 bin/haml
create mode 100755 bin/html2haml
create mode 100755 bin/htmldiff
create mode 100755 bin/ldiff
create mode 100755 bin/lessc
create mode 100755 bin/nokogiri
create mode 100755 bin/rackup
create mode 100755 bin/rails
create mode 100755 bin/rake
create mode 100755 bin/rdoc
create mode 100755 bin/restclient
create mode 100755 bin/ri
create mode 100755 bin/rspec
create mode 100755 bin/rubocop
create mode 100755 bin/ruby-parse
create mode 100755 bin/ruby-rewrite
create mode 100755 bin/ruby_parse
create mode 100755 bin/ruby_parse_extract_error
create mode 100755 bin/sdoc
create mode 100755 bin/sdoc-merge
create mode 100755 bin/sidekiq
create mode 100755 bin/sidekiqmon
create mode 100755 bin/sprockets
create mode 100755 bin/thor
create mode 100755 bin/tilt
diff --git a/.rubocop.yml b/.rubocop.yml
index df9ea17d..0229b48a 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -6,6 +6,7 @@ AllCops:
NewCops: enable
Exclude:
- 'db/schema.rb'
+ - 'bin/*'
Style/Documentation:
Enabled: false
diff --git a/bin/bundle b/bin/bundle
new file mode 100755
index 00000000..a71368e3
--- /dev/null
+++ b/bin/bundle
@@ -0,0 +1,114 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+#
+# This file was generated by Bundler.
+#
+# The application 'bundle' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require "rubygems"
+
+m = Module.new do
+ module_function
+
+ def invoked_as_script?
+ File.expand_path($0) == File.expand_path(__FILE__)
+ end
+
+ def env_var_version
+ ENV["BUNDLER_VERSION"]
+ end
+
+ def cli_arg_version
+ return unless invoked_as_script? # don't want to hijack other binstubs
+ return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`
+ bundler_version = nil
+ update_index = nil
+ ARGV.each_with_index do |a, i|
+ if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
+ bundler_version = a
+ end
+ next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
+ bundler_version = $1
+ update_index = i
+ end
+ bundler_version
+ end
+
+ def gemfile
+ gemfile = ENV["BUNDLE_GEMFILE"]
+ return gemfile if gemfile && !gemfile.empty?
+
+ File.expand_path("../../Gemfile", __FILE__)
+ end
+
+ def lockfile
+ lockfile =
+ case File.basename(gemfile)
+ when "gems.rb" then gemfile.sub(/\.rb$/, gemfile)
+ else "#{gemfile}.lock"
+ end
+ File.expand_path(lockfile)
+ end
+
+ def lockfile_version
+ return unless File.file?(lockfile)
+ lockfile_contents = File.read(lockfile)
+ return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
+ Regexp.last_match(1)
+ end
+
+ def bundler_version
+ @bundler_version ||=
+ env_var_version || cli_arg_version ||
+ lockfile_version
+ end
+
+ def bundler_requirement
+ return "#{Gem::Requirement.default}.a" unless bundler_version
+
+ bundler_gem_version = Gem::Version.new(bundler_version)
+
+ requirement = bundler_gem_version.approximate_recommendation
+
+ return requirement unless Gem::Version.new(Gem::VERSION) < Gem::Version.new("2.7.0")
+
+ requirement += ".a" if bundler_gem_version.prerelease?
+
+ requirement
+ end
+
+ def load_bundler!
+ ENV["BUNDLE_GEMFILE"] ||= gemfile
+
+ activate_bundler
+ end
+
+ def activate_bundler
+ gem_error = activation_error_handling do
+ gem "bundler", bundler_requirement
+ end
+ return if gem_error.nil?
+ require_error = activation_error_handling do
+ require "bundler/version"
+ end
+ return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
+ warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`"
+ exit 42
+ end
+
+ def activation_error_handling
+ yield
+ nil
+ rescue StandardError, LoadError => e
+ e
+ end
+end
+
+m.load_bundler!
+
+if m.invoked_as_script?
+ load Gem.bin_path("bundler", "bundle")
+end
diff --git a/bin/cap b/bin/cap
new file mode 100755
index 00000000..db774dc5
--- /dev/null
+++ b/bin/cap
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+#
+# This file was generated by Bundler.
+#
+# The application 'cap' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require "pathname"
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+bundle_binstub = File.expand_path("../bundle", __FILE__)
+
+if File.file?(bundle_binstub)
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
+ load(bundle_binstub)
+ else
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
+Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
+ end
+end
+
+require "rubygems"
+require "bundler/setup"
+
+load Gem.bin_path("capistrano", "cap")
diff --git a/bin/capify b/bin/capify
new file mode 100755
index 00000000..68921002
--- /dev/null
+++ b/bin/capify
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+#
+# This file was generated by Bundler.
+#
+# The application 'capify' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require "pathname"
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+bundle_binstub = File.expand_path("../bundle", __FILE__)
+
+if File.file?(bundle_binstub)
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
+ load(bundle_binstub)
+ else
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
+Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
+ end
+end
+
+require "rubygems"
+require "bundler/setup"
+
+load Gem.bin_path("capistrano", "capify")
diff --git a/bin/cucumber b/bin/cucumber
new file mode 100755
index 00000000..47845689
--- /dev/null
+++ b/bin/cucumber
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+#
+# This file was generated by Bundler.
+#
+# The application 'cucumber' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require "pathname"
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+bundle_binstub = File.expand_path("../bundle", __FILE__)
+
+if File.file?(bundle_binstub)
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
+ load(bundle_binstub)
+ else
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
+Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
+ end
+end
+
+require "rubygems"
+require "bundler/setup"
+
+load Gem.bin_path("cucumber", "cucumber")
diff --git a/bin/cucumber-tag-expressions b/bin/cucumber-tag-expressions
new file mode 100755
index 00000000..4ade386a
--- /dev/null
+++ b/bin/cucumber-tag-expressions
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+#
+# This file was generated by Bundler.
+#
+# The application 'cucumber-tag-expressions' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require "pathname"
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+bundle_binstub = File.expand_path("../bundle", __FILE__)
+
+if File.file?(bundle_binstub)
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
+ load(bundle_binstub)
+ else
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
+Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
+ end
+end
+
+require "rubygems"
+require "bundler/setup"
+
+load Gem.bin_path("cucumber-tag_expressions", "cucumber-tag-expressions")
diff --git a/bin/erubis b/bin/erubis
new file mode 100755
index 00000000..efd41a1c
--- /dev/null
+++ b/bin/erubis
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+#
+# This file was generated by Bundler.
+#
+# The application 'erubis' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require "pathname"
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+bundle_binstub = File.expand_path("../bundle", __FILE__)
+
+if File.file?(bundle_binstub)
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
+ load(bundle_binstub)
+ else
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
+Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
+ end
+end
+
+require "rubygems"
+require "bundler/setup"
+
+load Gem.bin_path("erubis", "erubis")
diff --git a/bin/gherkin b/bin/gherkin
new file mode 100755
index 00000000..e8115aaa
--- /dev/null
+++ b/bin/gherkin
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+#
+# This file was generated by Bundler.
+#
+# The application 'gherkin' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require "pathname"
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+bundle_binstub = File.expand_path("../bundle", __FILE__)
+
+if File.file?(bundle_binstub)
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
+ load(bundle_binstub)
+ else
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
+Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
+ end
+end
+
+require "rubygems"
+require "bundler/setup"
+
+load Gem.bin_path("gherkin", "gherkin")
diff --git a/bin/gherkin-ruby b/bin/gherkin-ruby
new file mode 100755
index 00000000..c3bc973f
--- /dev/null
+++ b/bin/gherkin-ruby
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+#
+# This file was generated by Bundler.
+#
+# The application 'gherkin-ruby' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require "pathname"
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+bundle_binstub = File.expand_path("../bundle", __FILE__)
+
+if File.file?(bundle_binstub)
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
+ load(bundle_binstub)
+ else
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
+Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
+ end
+end
+
+require "rubygems"
+require "bundler/setup"
+
+load Gem.bin_path("gherkin", "gherkin-ruby")
diff --git a/bin/haml b/bin/haml
new file mode 100755
index 00000000..2cc42c7e
--- /dev/null
+++ b/bin/haml
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+#
+# This file was generated by Bundler.
+#
+# The application 'haml' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require "pathname"
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+bundle_binstub = File.expand_path("../bundle", __FILE__)
+
+if File.file?(bundle_binstub)
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
+ load(bundle_binstub)
+ else
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
+Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
+ end
+end
+
+require "rubygems"
+require "bundler/setup"
+
+load Gem.bin_path("haml", "haml")
diff --git a/bin/html2haml b/bin/html2haml
new file mode 100755
index 00000000..02fc2699
--- /dev/null
+++ b/bin/html2haml
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+#
+# This file was generated by Bundler.
+#
+# The application 'html2haml' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require "pathname"
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+bundle_binstub = File.expand_path("../bundle", __FILE__)
+
+if File.file?(bundle_binstub)
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
+ load(bundle_binstub)
+ else
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
+Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
+ end
+end
+
+require "rubygems"
+require "bundler/setup"
+
+load Gem.bin_path("html2haml", "html2haml")
diff --git a/bin/htmldiff b/bin/htmldiff
new file mode 100755
index 00000000..091820c9
--- /dev/null
+++ b/bin/htmldiff
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+#
+# This file was generated by Bundler.
+#
+# The application 'htmldiff' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require "pathname"
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+bundle_binstub = File.expand_path("../bundle", __FILE__)
+
+if File.file?(bundle_binstub)
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
+ load(bundle_binstub)
+ else
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
+Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
+ end
+end
+
+require "rubygems"
+require "bundler/setup"
+
+load Gem.bin_path("diff-lcs", "htmldiff")
diff --git a/bin/ldiff b/bin/ldiff
new file mode 100755
index 00000000..073e19f2
--- /dev/null
+++ b/bin/ldiff
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+#
+# This file was generated by Bundler.
+#
+# The application 'ldiff' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require "pathname"
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+bundle_binstub = File.expand_path("../bundle", __FILE__)
+
+if File.file?(bundle_binstub)
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
+ load(bundle_binstub)
+ else
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
+Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
+ end
+end
+
+require "rubygems"
+require "bundler/setup"
+
+load Gem.bin_path("diff-lcs", "ldiff")
diff --git a/bin/lessc b/bin/lessc
new file mode 100755
index 00000000..62ad40c6
--- /dev/null
+++ b/bin/lessc
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+#
+# This file was generated by Bundler.
+#
+# The application 'lessc' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require "pathname"
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+bundle_binstub = File.expand_path("../bundle", __FILE__)
+
+if File.file?(bundle_binstub)
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
+ load(bundle_binstub)
+ else
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
+Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
+ end
+end
+
+require "rubygems"
+require "bundler/setup"
+
+load Gem.bin_path("less", "lessc")
diff --git a/bin/nokogiri b/bin/nokogiri
new file mode 100755
index 00000000..b22a1a0a
--- /dev/null
+++ b/bin/nokogiri
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+#
+# This file was generated by Bundler.
+#
+# The application 'nokogiri' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require "pathname"
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+bundle_binstub = File.expand_path("../bundle", __FILE__)
+
+if File.file?(bundle_binstub)
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
+ load(bundle_binstub)
+ else
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
+Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
+ end
+end
+
+require "rubygems"
+require "bundler/setup"
+
+load Gem.bin_path("nokogiri", "nokogiri")
diff --git a/bin/rackup b/bin/rackup
new file mode 100755
index 00000000..3ac4a5a7
--- /dev/null
+++ b/bin/rackup
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+#
+# This file was generated by Bundler.
+#
+# The application 'rackup' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require "pathname"
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+bundle_binstub = File.expand_path("../bundle", __FILE__)
+
+if File.file?(bundle_binstub)
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
+ load(bundle_binstub)
+ else
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
+Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
+ end
+end
+
+require "rubygems"
+require "bundler/setup"
+
+load Gem.bin_path("rack", "rackup")
diff --git a/bin/rails b/bin/rails
new file mode 100755
index 00000000..7fd59cc7
--- /dev/null
+++ b/bin/rails
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+#
+# This file was generated by Bundler.
+#
+# The application 'rails' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require "pathname"
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+bundle_binstub = File.expand_path("../bundle", __FILE__)
+
+if File.file?(bundle_binstub)
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
+ load(bundle_binstub)
+ else
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
+Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
+ end
+end
+
+require "rubygems"
+require "bundler/setup"
+
+load Gem.bin_path("railties", "rails")
diff --git a/bin/rake b/bin/rake
new file mode 100755
index 00000000..9275675e
--- /dev/null
+++ b/bin/rake
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+#
+# This file was generated by Bundler.
+#
+# The application 'rake' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require "pathname"
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+bundle_binstub = File.expand_path("../bundle", __FILE__)
+
+if File.file?(bundle_binstub)
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
+ load(bundle_binstub)
+ else
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
+Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
+ end
+end
+
+require "rubygems"
+require "bundler/setup"
+
+load Gem.bin_path("rake", "rake")
diff --git a/bin/rdoc b/bin/rdoc
new file mode 100755
index 00000000..a952e798
--- /dev/null
+++ b/bin/rdoc
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+#
+# This file was generated by Bundler.
+#
+# The application 'rdoc' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require "pathname"
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+bundle_binstub = File.expand_path("../bundle", __FILE__)
+
+if File.file?(bundle_binstub)
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
+ load(bundle_binstub)
+ else
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
+Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
+ end
+end
+
+require "rubygems"
+require "bundler/setup"
+
+load Gem.bin_path("rdoc", "rdoc")
diff --git a/bin/restclient b/bin/restclient
new file mode 100755
index 00000000..6cff4172
--- /dev/null
+++ b/bin/restclient
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+#
+# This file was generated by Bundler.
+#
+# The application 'restclient' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require "pathname"
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+bundle_binstub = File.expand_path("../bundle", __FILE__)
+
+if File.file?(bundle_binstub)
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
+ load(bundle_binstub)
+ else
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
+Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
+ end
+end
+
+require "rubygems"
+require "bundler/setup"
+
+load Gem.bin_path("rest-client", "restclient")
diff --git a/bin/ri b/bin/ri
new file mode 100755
index 00000000..2c93cf92
--- /dev/null
+++ b/bin/ri
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+#
+# This file was generated by Bundler.
+#
+# The application 'ri' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require "pathname"
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+bundle_binstub = File.expand_path("../bundle", __FILE__)
+
+if File.file?(bundle_binstub)
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
+ load(bundle_binstub)
+ else
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
+Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
+ end
+end
+
+require "rubygems"
+require "bundler/setup"
+
+load Gem.bin_path("rdoc", "ri")
diff --git a/bin/rspec b/bin/rspec
new file mode 100755
index 00000000..a6c78521
--- /dev/null
+++ b/bin/rspec
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+#
+# This file was generated by Bundler.
+#
+# The application 'rspec' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require "pathname"
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+bundle_binstub = File.expand_path("../bundle", __FILE__)
+
+if File.file?(bundle_binstub)
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
+ load(bundle_binstub)
+ else
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
+Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
+ end
+end
+
+require "rubygems"
+require "bundler/setup"
+
+load Gem.bin_path("rspec-core", "rspec")
diff --git a/bin/rubocop b/bin/rubocop
new file mode 100755
index 00000000..d0c48829
--- /dev/null
+++ b/bin/rubocop
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+#
+# This file was generated by Bundler.
+#
+# The application 'rubocop' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require "pathname"
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+bundle_binstub = File.expand_path("../bundle", __FILE__)
+
+if File.file?(bundle_binstub)
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
+ load(bundle_binstub)
+ else
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
+Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
+ end
+end
+
+require "rubygems"
+require "bundler/setup"
+
+load Gem.bin_path("rubocop", "rubocop")
diff --git a/bin/ruby-parse b/bin/ruby-parse
new file mode 100755
index 00000000..74d87beb
--- /dev/null
+++ b/bin/ruby-parse
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+#
+# This file was generated by Bundler.
+#
+# The application 'ruby-parse' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require "pathname"
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+bundle_binstub = File.expand_path("../bundle", __FILE__)
+
+if File.file?(bundle_binstub)
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
+ load(bundle_binstub)
+ else
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
+Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
+ end
+end
+
+require "rubygems"
+require "bundler/setup"
+
+load Gem.bin_path("parser", "ruby-parse")
diff --git a/bin/ruby-rewrite b/bin/ruby-rewrite
new file mode 100755
index 00000000..972bc456
--- /dev/null
+++ b/bin/ruby-rewrite
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+#
+# This file was generated by Bundler.
+#
+# The application 'ruby-rewrite' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require "pathname"
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+bundle_binstub = File.expand_path("../bundle", __FILE__)
+
+if File.file?(bundle_binstub)
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
+ load(bundle_binstub)
+ else
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
+Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
+ end
+end
+
+require "rubygems"
+require "bundler/setup"
+
+load Gem.bin_path("parser", "ruby-rewrite")
diff --git a/bin/ruby_parse b/bin/ruby_parse
new file mode 100755
index 00000000..56d914e9
--- /dev/null
+++ b/bin/ruby_parse
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+#
+# This file was generated by Bundler.
+#
+# The application 'ruby_parse' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require "pathname"
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+bundle_binstub = File.expand_path("../bundle", __FILE__)
+
+if File.file?(bundle_binstub)
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
+ load(bundle_binstub)
+ else
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
+Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
+ end
+end
+
+require "rubygems"
+require "bundler/setup"
+
+load Gem.bin_path("ruby_parser", "ruby_parse")
diff --git a/bin/ruby_parse_extract_error b/bin/ruby_parse_extract_error
new file mode 100755
index 00000000..da559731
--- /dev/null
+++ b/bin/ruby_parse_extract_error
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+#
+# This file was generated by Bundler.
+#
+# The application 'ruby_parse_extract_error' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require "pathname"
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+bundle_binstub = File.expand_path("../bundle", __FILE__)
+
+if File.file?(bundle_binstub)
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
+ load(bundle_binstub)
+ else
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
+Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
+ end
+end
+
+require "rubygems"
+require "bundler/setup"
+
+load Gem.bin_path("ruby_parser", "ruby_parse_extract_error")
diff --git a/bin/sdoc b/bin/sdoc
new file mode 100755
index 00000000..b84b0e42
--- /dev/null
+++ b/bin/sdoc
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+#
+# This file was generated by Bundler.
+#
+# The application 'sdoc' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require "pathname"
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+bundle_binstub = File.expand_path("../bundle", __FILE__)
+
+if File.file?(bundle_binstub)
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
+ load(bundle_binstub)
+ else
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
+Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
+ end
+end
+
+require "rubygems"
+require "bundler/setup"
+
+load Gem.bin_path("sdoc", "sdoc")
diff --git a/bin/sdoc-merge b/bin/sdoc-merge
new file mode 100755
index 00000000..10832b99
--- /dev/null
+++ b/bin/sdoc-merge
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+#
+# This file was generated by Bundler.
+#
+# The application 'sdoc-merge' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require "pathname"
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+bundle_binstub = File.expand_path("../bundle", __FILE__)
+
+if File.file?(bundle_binstub)
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
+ load(bundle_binstub)
+ else
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
+Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
+ end
+end
+
+require "rubygems"
+require "bundler/setup"
+
+load Gem.bin_path("sdoc", "sdoc-merge")
diff --git a/bin/sidekiq b/bin/sidekiq
new file mode 100755
index 00000000..9e754999
--- /dev/null
+++ b/bin/sidekiq
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+#
+# This file was generated by Bundler.
+#
+# The application 'sidekiq' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require "pathname"
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+bundle_binstub = File.expand_path("../bundle", __FILE__)
+
+if File.file?(bundle_binstub)
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
+ load(bundle_binstub)
+ else
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
+Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
+ end
+end
+
+require "rubygems"
+require "bundler/setup"
+
+load Gem.bin_path("sidekiq", "sidekiq")
diff --git a/bin/sidekiqmon b/bin/sidekiqmon
new file mode 100755
index 00000000..fedda51c
--- /dev/null
+++ b/bin/sidekiqmon
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+#
+# This file was generated by Bundler.
+#
+# The application 'sidekiqmon' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require "pathname"
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+bundle_binstub = File.expand_path("../bundle", __FILE__)
+
+if File.file?(bundle_binstub)
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
+ load(bundle_binstub)
+ else
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
+Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
+ end
+end
+
+require "rubygems"
+require "bundler/setup"
+
+load Gem.bin_path("sidekiq", "sidekiqmon")
diff --git a/bin/sprockets b/bin/sprockets
new file mode 100755
index 00000000..9f75aa74
--- /dev/null
+++ b/bin/sprockets
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+#
+# This file was generated by Bundler.
+#
+# The application 'sprockets' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require "pathname"
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+bundle_binstub = File.expand_path("../bundle", __FILE__)
+
+if File.file?(bundle_binstub)
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
+ load(bundle_binstub)
+ else
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
+Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
+ end
+end
+
+require "rubygems"
+require "bundler/setup"
+
+load Gem.bin_path("sprockets", "sprockets")
diff --git a/bin/thor b/bin/thor
new file mode 100755
index 00000000..71bfaeae
--- /dev/null
+++ b/bin/thor
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+#
+# This file was generated by Bundler.
+#
+# The application 'thor' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require "pathname"
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+bundle_binstub = File.expand_path("../bundle", __FILE__)
+
+if File.file?(bundle_binstub)
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
+ load(bundle_binstub)
+ else
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
+Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
+ end
+end
+
+require "rubygems"
+require "bundler/setup"
+
+load Gem.bin_path("thor", "thor")
diff --git a/bin/tilt b/bin/tilt
new file mode 100755
index 00000000..34f7bcaa
--- /dev/null
+++ b/bin/tilt
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+#
+# This file was generated by Bundler.
+#
+# The application 'tilt' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require "pathname"
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+bundle_binstub = File.expand_path("../bundle", __FILE__)
+
+if File.file?(bundle_binstub)
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
+ load(bundle_binstub)
+ else
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
+Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
+ end
+end
+
+require "rubygems"
+require "bundler/setup"
+
+load Gem.bin_path("tilt", "tilt")
From bdd19d7ca46175ecee4f4290a1341a966a8e06fe Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 22 Nov 2020 13:02:31 +0100
Subject: [PATCH 070/159] fixed search pagination
---
app/helpers/projects_helper.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index 661ec155..c8e38e03 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -40,6 +40,6 @@ def shield_url(project)
end
def permitted_params
- params.permit(:order, :page)
+ params.permit(:order, :page, :query, :utf8)
end
end
From a9a83d9f062baef8952526a1fcb5ae6701536aca Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 22 Nov 2020 13:08:56 +0100
Subject: [PATCH 071/159] fixed binstub
---
bin/bundle | 115 +----------------------------------
bin/cap | 29 ---------
bin/capify | 29 ---------
bin/cucumber | 29 ---------
bin/cucumber-tag-expressions | 29 ---------
bin/erubis | 29 ---------
bin/gherkin | 29 ---------
bin/gherkin-ruby | 29 ---------
bin/haml | 29 ---------
bin/html2haml | 29 ---------
bin/htmldiff | 29 ---------
bin/ldiff | 29 ---------
bin/lessc | 29 ---------
bin/nokogiri | 29 ---------
bin/rackup | 29 ---------
bin/rails | 31 +---------
bin/rake | 31 +---------
bin/rdoc | 29 ---------
bin/restclient | 29 ---------
bin/ri | 29 ---------
bin/rspec | 29 ---------
bin/rubocop | 29 ---------
bin/ruby-parse | 29 ---------
bin/ruby-rewrite | 29 ---------
bin/ruby_parse | 29 ---------
bin/ruby_parse_extract_error | 29 ---------
bin/sdoc | 29 ---------
bin/sdoc-merge | 29 ---------
bin/setup | 36 +++++++++++
bin/sidekiq | 29 ---------
bin/sidekiqmon | 29 ---------
bin/sprockets | 29 ---------
bin/thor | 29 ---------
bin/tilt | 29 ---------
bin/update | 31 ++++++++++
bin/yarn | 11 ++++
36 files changed, 86 insertions(+), 1039 deletions(-)
delete mode 100755 bin/cap
delete mode 100755 bin/capify
delete mode 100755 bin/cucumber
delete mode 100755 bin/cucumber-tag-expressions
delete mode 100755 bin/erubis
delete mode 100755 bin/gherkin
delete mode 100755 bin/gherkin-ruby
delete mode 100755 bin/haml
delete mode 100755 bin/html2haml
delete mode 100755 bin/htmldiff
delete mode 100755 bin/ldiff
delete mode 100755 bin/lessc
delete mode 100755 bin/nokogiri
delete mode 100755 bin/rackup
delete mode 100755 bin/rdoc
delete mode 100755 bin/restclient
delete mode 100755 bin/ri
delete mode 100755 bin/rspec
delete mode 100755 bin/rubocop
delete mode 100755 bin/ruby-parse
delete mode 100755 bin/ruby-rewrite
delete mode 100755 bin/ruby_parse
delete mode 100755 bin/ruby_parse_extract_error
delete mode 100755 bin/sdoc
delete mode 100755 bin/sdoc-merge
create mode 100755 bin/setup
delete mode 100755 bin/sidekiq
delete mode 100755 bin/sidekiqmon
delete mode 100755 bin/sprockets
delete mode 100755 bin/thor
delete mode 100755 bin/tilt
create mode 100755 bin/update
create mode 100755 bin/yarn
diff --git a/bin/bundle b/bin/bundle
index a71368e3..f19acf5b 100755
--- a/bin/bundle
+++ b/bin/bundle
@@ -1,114 +1,3 @@
#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-#
-# This file was generated by Bundler.
-#
-# The application 'bundle' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "rubygems"
-
-m = Module.new do
- module_function
-
- def invoked_as_script?
- File.expand_path($0) == File.expand_path(__FILE__)
- end
-
- def env_var_version
- ENV["BUNDLER_VERSION"]
- end
-
- def cli_arg_version
- return unless invoked_as_script? # don't want to hijack other binstubs
- return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`
- bundler_version = nil
- update_index = nil
- ARGV.each_with_index do |a, i|
- if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
- bundler_version = a
- end
- next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
- bundler_version = $1
- update_index = i
- end
- bundler_version
- end
-
- def gemfile
- gemfile = ENV["BUNDLE_GEMFILE"]
- return gemfile if gemfile && !gemfile.empty?
-
- File.expand_path("../../Gemfile", __FILE__)
- end
-
- def lockfile
- lockfile =
- case File.basename(gemfile)
- when "gems.rb" then gemfile.sub(/\.rb$/, gemfile)
- else "#{gemfile}.lock"
- end
- File.expand_path(lockfile)
- end
-
- def lockfile_version
- return unless File.file?(lockfile)
- lockfile_contents = File.read(lockfile)
- return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
- Regexp.last_match(1)
- end
-
- def bundler_version
- @bundler_version ||=
- env_var_version || cli_arg_version ||
- lockfile_version
- end
-
- def bundler_requirement
- return "#{Gem::Requirement.default}.a" unless bundler_version
-
- bundler_gem_version = Gem::Version.new(bundler_version)
-
- requirement = bundler_gem_version.approximate_recommendation
-
- return requirement unless Gem::Version.new(Gem::VERSION) < Gem::Version.new("2.7.0")
-
- requirement += ".a" if bundler_gem_version.prerelease?
-
- requirement
- end
-
- def load_bundler!
- ENV["BUNDLE_GEMFILE"] ||= gemfile
-
- activate_bundler
- end
-
- def activate_bundler
- gem_error = activation_error_handling do
- gem "bundler", bundler_requirement
- end
- return if gem_error.nil?
- require_error = activation_error_handling do
- require "bundler/version"
- end
- return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
- warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`"
- exit 42
- end
-
- def activation_error_handling
- yield
- nil
- rescue StandardError, LoadError => e
- e
- end
-end
-
-m.load_bundler!
-
-if m.invoked_as_script?
- load Gem.bin_path("bundler", "bundle")
-end
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
+load Gem.bin_path('bundler', 'bundle')
diff --git a/bin/cap b/bin/cap
deleted file mode 100755
index db774dc5..00000000
--- a/bin/cap
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-#
-# This file was generated by Bundler.
-#
-# The application 'cap' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "pathname"
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-bundle_binstub = File.expand_path("../bundle", __FILE__)
-
-if File.file?(bundle_binstub)
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
- load(bundle_binstub)
- else
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
-Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
- end
-end
-
-require "rubygems"
-require "bundler/setup"
-
-load Gem.bin_path("capistrano", "cap")
diff --git a/bin/capify b/bin/capify
deleted file mode 100755
index 68921002..00000000
--- a/bin/capify
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-#
-# This file was generated by Bundler.
-#
-# The application 'capify' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "pathname"
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-bundle_binstub = File.expand_path("../bundle", __FILE__)
-
-if File.file?(bundle_binstub)
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
- load(bundle_binstub)
- else
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
-Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
- end
-end
-
-require "rubygems"
-require "bundler/setup"
-
-load Gem.bin_path("capistrano", "capify")
diff --git a/bin/cucumber b/bin/cucumber
deleted file mode 100755
index 47845689..00000000
--- a/bin/cucumber
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-#
-# This file was generated by Bundler.
-#
-# The application 'cucumber' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "pathname"
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-bundle_binstub = File.expand_path("../bundle", __FILE__)
-
-if File.file?(bundle_binstub)
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
- load(bundle_binstub)
- else
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
-Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
- end
-end
-
-require "rubygems"
-require "bundler/setup"
-
-load Gem.bin_path("cucumber", "cucumber")
diff --git a/bin/cucumber-tag-expressions b/bin/cucumber-tag-expressions
deleted file mode 100755
index 4ade386a..00000000
--- a/bin/cucumber-tag-expressions
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-#
-# This file was generated by Bundler.
-#
-# The application 'cucumber-tag-expressions' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "pathname"
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-bundle_binstub = File.expand_path("../bundle", __FILE__)
-
-if File.file?(bundle_binstub)
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
- load(bundle_binstub)
- else
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
-Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
- end
-end
-
-require "rubygems"
-require "bundler/setup"
-
-load Gem.bin_path("cucumber-tag_expressions", "cucumber-tag-expressions")
diff --git a/bin/erubis b/bin/erubis
deleted file mode 100755
index efd41a1c..00000000
--- a/bin/erubis
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-#
-# This file was generated by Bundler.
-#
-# The application 'erubis' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "pathname"
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-bundle_binstub = File.expand_path("../bundle", __FILE__)
-
-if File.file?(bundle_binstub)
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
- load(bundle_binstub)
- else
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
-Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
- end
-end
-
-require "rubygems"
-require "bundler/setup"
-
-load Gem.bin_path("erubis", "erubis")
diff --git a/bin/gherkin b/bin/gherkin
deleted file mode 100755
index e8115aaa..00000000
--- a/bin/gherkin
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-#
-# This file was generated by Bundler.
-#
-# The application 'gherkin' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "pathname"
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-bundle_binstub = File.expand_path("../bundle", __FILE__)
-
-if File.file?(bundle_binstub)
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
- load(bundle_binstub)
- else
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
-Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
- end
-end
-
-require "rubygems"
-require "bundler/setup"
-
-load Gem.bin_path("gherkin", "gherkin")
diff --git a/bin/gherkin-ruby b/bin/gherkin-ruby
deleted file mode 100755
index c3bc973f..00000000
--- a/bin/gherkin-ruby
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-#
-# This file was generated by Bundler.
-#
-# The application 'gherkin-ruby' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "pathname"
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-bundle_binstub = File.expand_path("../bundle", __FILE__)
-
-if File.file?(bundle_binstub)
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
- load(bundle_binstub)
- else
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
-Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
- end
-end
-
-require "rubygems"
-require "bundler/setup"
-
-load Gem.bin_path("gherkin", "gherkin-ruby")
diff --git a/bin/haml b/bin/haml
deleted file mode 100755
index 2cc42c7e..00000000
--- a/bin/haml
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-#
-# This file was generated by Bundler.
-#
-# The application 'haml' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "pathname"
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-bundle_binstub = File.expand_path("../bundle", __FILE__)
-
-if File.file?(bundle_binstub)
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
- load(bundle_binstub)
- else
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
-Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
- end
-end
-
-require "rubygems"
-require "bundler/setup"
-
-load Gem.bin_path("haml", "haml")
diff --git a/bin/html2haml b/bin/html2haml
deleted file mode 100755
index 02fc2699..00000000
--- a/bin/html2haml
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-#
-# This file was generated by Bundler.
-#
-# The application 'html2haml' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "pathname"
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-bundle_binstub = File.expand_path("../bundle", __FILE__)
-
-if File.file?(bundle_binstub)
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
- load(bundle_binstub)
- else
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
-Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
- end
-end
-
-require "rubygems"
-require "bundler/setup"
-
-load Gem.bin_path("html2haml", "html2haml")
diff --git a/bin/htmldiff b/bin/htmldiff
deleted file mode 100755
index 091820c9..00000000
--- a/bin/htmldiff
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-#
-# This file was generated by Bundler.
-#
-# The application 'htmldiff' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "pathname"
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-bundle_binstub = File.expand_path("../bundle", __FILE__)
-
-if File.file?(bundle_binstub)
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
- load(bundle_binstub)
- else
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
-Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
- end
-end
-
-require "rubygems"
-require "bundler/setup"
-
-load Gem.bin_path("diff-lcs", "htmldiff")
diff --git a/bin/ldiff b/bin/ldiff
deleted file mode 100755
index 073e19f2..00000000
--- a/bin/ldiff
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-#
-# This file was generated by Bundler.
-#
-# The application 'ldiff' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "pathname"
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-bundle_binstub = File.expand_path("../bundle", __FILE__)
-
-if File.file?(bundle_binstub)
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
- load(bundle_binstub)
- else
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
-Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
- end
-end
-
-require "rubygems"
-require "bundler/setup"
-
-load Gem.bin_path("diff-lcs", "ldiff")
diff --git a/bin/lessc b/bin/lessc
deleted file mode 100755
index 62ad40c6..00000000
--- a/bin/lessc
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-#
-# This file was generated by Bundler.
-#
-# The application 'lessc' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "pathname"
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-bundle_binstub = File.expand_path("../bundle", __FILE__)
-
-if File.file?(bundle_binstub)
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
- load(bundle_binstub)
- else
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
-Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
- end
-end
-
-require "rubygems"
-require "bundler/setup"
-
-load Gem.bin_path("less", "lessc")
diff --git a/bin/nokogiri b/bin/nokogiri
deleted file mode 100755
index b22a1a0a..00000000
--- a/bin/nokogiri
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-#
-# This file was generated by Bundler.
-#
-# The application 'nokogiri' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "pathname"
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-bundle_binstub = File.expand_path("../bundle", __FILE__)
-
-if File.file?(bundle_binstub)
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
- load(bundle_binstub)
- else
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
-Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
- end
-end
-
-require "rubygems"
-require "bundler/setup"
-
-load Gem.bin_path("nokogiri", "nokogiri")
diff --git a/bin/rackup b/bin/rackup
deleted file mode 100755
index 3ac4a5a7..00000000
--- a/bin/rackup
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-#
-# This file was generated by Bundler.
-#
-# The application 'rackup' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "pathname"
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-bundle_binstub = File.expand_path("../bundle", __FILE__)
-
-if File.file?(bundle_binstub)
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
- load(bundle_binstub)
- else
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
-Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
- end
-end
-
-require "rubygems"
-require "bundler/setup"
-
-load Gem.bin_path("rack", "rackup")
diff --git a/bin/rails b/bin/rails
index 7fd59cc7..07396602 100755
--- a/bin/rails
+++ b/bin/rails
@@ -1,29 +1,4 @@
#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-#
-# This file was generated by Bundler.
-#
-# The application 'rails' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "pathname"
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-bundle_binstub = File.expand_path("../bundle", __FILE__)
-
-if File.file?(bundle_binstub)
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
- load(bundle_binstub)
- else
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
-Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
- end
-end
-
-require "rubygems"
-require "bundler/setup"
-
-load Gem.bin_path("railties", "rails")
+APP_PATH = File.expand_path('../config/application', __dir__)
+require_relative '../config/boot'
+require 'rails/commands'
diff --git a/bin/rake b/bin/rake
index 9275675e..17240489 100755
--- a/bin/rake
+++ b/bin/rake
@@ -1,29 +1,4 @@
#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-#
-# This file was generated by Bundler.
-#
-# The application 'rake' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "pathname"
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-bundle_binstub = File.expand_path("../bundle", __FILE__)
-
-if File.file?(bundle_binstub)
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
- load(bundle_binstub)
- else
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
-Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
- end
-end
-
-require "rubygems"
-require "bundler/setup"
-
-load Gem.bin_path("rake", "rake")
+require_relative '../config/boot'
+require 'rake'
+Rake.application.run
diff --git a/bin/rdoc b/bin/rdoc
deleted file mode 100755
index a952e798..00000000
--- a/bin/rdoc
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-#
-# This file was generated by Bundler.
-#
-# The application 'rdoc' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "pathname"
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-bundle_binstub = File.expand_path("../bundle", __FILE__)
-
-if File.file?(bundle_binstub)
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
- load(bundle_binstub)
- else
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
-Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
- end
-end
-
-require "rubygems"
-require "bundler/setup"
-
-load Gem.bin_path("rdoc", "rdoc")
diff --git a/bin/restclient b/bin/restclient
deleted file mode 100755
index 6cff4172..00000000
--- a/bin/restclient
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-#
-# This file was generated by Bundler.
-#
-# The application 'restclient' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "pathname"
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-bundle_binstub = File.expand_path("../bundle", __FILE__)
-
-if File.file?(bundle_binstub)
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
- load(bundle_binstub)
- else
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
-Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
- end
-end
-
-require "rubygems"
-require "bundler/setup"
-
-load Gem.bin_path("rest-client", "restclient")
diff --git a/bin/ri b/bin/ri
deleted file mode 100755
index 2c93cf92..00000000
--- a/bin/ri
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-#
-# This file was generated by Bundler.
-#
-# The application 'ri' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "pathname"
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-bundle_binstub = File.expand_path("../bundle", __FILE__)
-
-if File.file?(bundle_binstub)
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
- load(bundle_binstub)
- else
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
-Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
- end
-end
-
-require "rubygems"
-require "bundler/setup"
-
-load Gem.bin_path("rdoc", "ri")
diff --git a/bin/rspec b/bin/rspec
deleted file mode 100755
index a6c78521..00000000
--- a/bin/rspec
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-#
-# This file was generated by Bundler.
-#
-# The application 'rspec' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "pathname"
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-bundle_binstub = File.expand_path("../bundle", __FILE__)
-
-if File.file?(bundle_binstub)
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
- load(bundle_binstub)
- else
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
-Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
- end
-end
-
-require "rubygems"
-require "bundler/setup"
-
-load Gem.bin_path("rspec-core", "rspec")
diff --git a/bin/rubocop b/bin/rubocop
deleted file mode 100755
index d0c48829..00000000
--- a/bin/rubocop
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-#
-# This file was generated by Bundler.
-#
-# The application 'rubocop' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "pathname"
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-bundle_binstub = File.expand_path("../bundle", __FILE__)
-
-if File.file?(bundle_binstub)
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
- load(bundle_binstub)
- else
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
-Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
- end
-end
-
-require "rubygems"
-require "bundler/setup"
-
-load Gem.bin_path("rubocop", "rubocop")
diff --git a/bin/ruby-parse b/bin/ruby-parse
deleted file mode 100755
index 74d87beb..00000000
--- a/bin/ruby-parse
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-#
-# This file was generated by Bundler.
-#
-# The application 'ruby-parse' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "pathname"
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-bundle_binstub = File.expand_path("../bundle", __FILE__)
-
-if File.file?(bundle_binstub)
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
- load(bundle_binstub)
- else
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
-Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
- end
-end
-
-require "rubygems"
-require "bundler/setup"
-
-load Gem.bin_path("parser", "ruby-parse")
diff --git a/bin/ruby-rewrite b/bin/ruby-rewrite
deleted file mode 100755
index 972bc456..00000000
--- a/bin/ruby-rewrite
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-#
-# This file was generated by Bundler.
-#
-# The application 'ruby-rewrite' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "pathname"
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-bundle_binstub = File.expand_path("../bundle", __FILE__)
-
-if File.file?(bundle_binstub)
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
- load(bundle_binstub)
- else
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
-Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
- end
-end
-
-require "rubygems"
-require "bundler/setup"
-
-load Gem.bin_path("parser", "ruby-rewrite")
diff --git a/bin/ruby_parse b/bin/ruby_parse
deleted file mode 100755
index 56d914e9..00000000
--- a/bin/ruby_parse
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-#
-# This file was generated by Bundler.
-#
-# The application 'ruby_parse' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "pathname"
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-bundle_binstub = File.expand_path("../bundle", __FILE__)
-
-if File.file?(bundle_binstub)
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
- load(bundle_binstub)
- else
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
-Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
- end
-end
-
-require "rubygems"
-require "bundler/setup"
-
-load Gem.bin_path("ruby_parser", "ruby_parse")
diff --git a/bin/ruby_parse_extract_error b/bin/ruby_parse_extract_error
deleted file mode 100755
index da559731..00000000
--- a/bin/ruby_parse_extract_error
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-#
-# This file was generated by Bundler.
-#
-# The application 'ruby_parse_extract_error' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "pathname"
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-bundle_binstub = File.expand_path("../bundle", __FILE__)
-
-if File.file?(bundle_binstub)
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
- load(bundle_binstub)
- else
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
-Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
- end
-end
-
-require "rubygems"
-require "bundler/setup"
-
-load Gem.bin_path("ruby_parser", "ruby_parse_extract_error")
diff --git a/bin/sdoc b/bin/sdoc
deleted file mode 100755
index b84b0e42..00000000
--- a/bin/sdoc
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-#
-# This file was generated by Bundler.
-#
-# The application 'sdoc' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "pathname"
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-bundle_binstub = File.expand_path("../bundle", __FILE__)
-
-if File.file?(bundle_binstub)
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
- load(bundle_binstub)
- else
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
-Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
- end
-end
-
-require "rubygems"
-require "bundler/setup"
-
-load Gem.bin_path("sdoc", "sdoc")
diff --git a/bin/sdoc-merge b/bin/sdoc-merge
deleted file mode 100755
index 10832b99..00000000
--- a/bin/sdoc-merge
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-#
-# This file was generated by Bundler.
-#
-# The application 'sdoc-merge' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "pathname"
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-bundle_binstub = File.expand_path("../bundle", __FILE__)
-
-if File.file?(bundle_binstub)
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
- load(bundle_binstub)
- else
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
-Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
- end
-end
-
-require "rubygems"
-require "bundler/setup"
-
-load Gem.bin_path("sdoc", "sdoc-merge")
diff --git a/bin/setup b/bin/setup
new file mode 100755
index 00000000..94fd4d79
--- /dev/null
+++ b/bin/setup
@@ -0,0 +1,36 @@
+#!/usr/bin/env ruby
+require 'fileutils'
+include FileUtils
+
+# path to your application root.
+APP_ROOT = File.expand_path('..', __dir__)
+
+def system!(*args)
+ system(*args) || abort("\n== Command #{args} failed ==")
+end
+
+chdir APP_ROOT do
+ # This script is a starting point to setup your application.
+ # Add necessary setup steps to this file.
+
+ puts '== Installing dependencies =='
+ system! 'gem install bundler --conservative'
+ system('bundle check') || system!('bundle install')
+
+ # Install JavaScript dependencies if using Yarn
+ # system('bin/yarn')
+
+ # puts "\n== Copying sample files =="
+ # unless File.exist?('config/database.yml')
+ # cp 'config/database.yml.sample', 'config/database.yml'
+ # end
+
+ puts "\n== Preparing database =="
+ system! 'bin/rails db:setup'
+
+ puts "\n== Removing old logs and tempfiles =="
+ system! 'bin/rails log:clear tmp:clear'
+
+ puts "\n== Restarting application server =="
+ system! 'bin/rails restart'
+end
diff --git a/bin/sidekiq b/bin/sidekiq
deleted file mode 100755
index 9e754999..00000000
--- a/bin/sidekiq
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-#
-# This file was generated by Bundler.
-#
-# The application 'sidekiq' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "pathname"
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-bundle_binstub = File.expand_path("../bundle", __FILE__)
-
-if File.file?(bundle_binstub)
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
- load(bundle_binstub)
- else
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
-Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
- end
-end
-
-require "rubygems"
-require "bundler/setup"
-
-load Gem.bin_path("sidekiq", "sidekiq")
diff --git a/bin/sidekiqmon b/bin/sidekiqmon
deleted file mode 100755
index fedda51c..00000000
--- a/bin/sidekiqmon
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-#
-# This file was generated by Bundler.
-#
-# The application 'sidekiqmon' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "pathname"
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-bundle_binstub = File.expand_path("../bundle", __FILE__)
-
-if File.file?(bundle_binstub)
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
- load(bundle_binstub)
- else
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
-Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
- end
-end
-
-require "rubygems"
-require "bundler/setup"
-
-load Gem.bin_path("sidekiq", "sidekiqmon")
diff --git a/bin/sprockets b/bin/sprockets
deleted file mode 100755
index 9f75aa74..00000000
--- a/bin/sprockets
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-#
-# This file was generated by Bundler.
-#
-# The application 'sprockets' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "pathname"
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-bundle_binstub = File.expand_path("../bundle", __FILE__)
-
-if File.file?(bundle_binstub)
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
- load(bundle_binstub)
- else
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
-Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
- end
-end
-
-require "rubygems"
-require "bundler/setup"
-
-load Gem.bin_path("sprockets", "sprockets")
diff --git a/bin/thor b/bin/thor
deleted file mode 100755
index 71bfaeae..00000000
--- a/bin/thor
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-#
-# This file was generated by Bundler.
-#
-# The application 'thor' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "pathname"
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-bundle_binstub = File.expand_path("../bundle", __FILE__)
-
-if File.file?(bundle_binstub)
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
- load(bundle_binstub)
- else
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
-Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
- end
-end
-
-require "rubygems"
-require "bundler/setup"
-
-load Gem.bin_path("thor", "thor")
diff --git a/bin/tilt b/bin/tilt
deleted file mode 100755
index 34f7bcaa..00000000
--- a/bin/tilt
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-#
-# This file was generated by Bundler.
-#
-# The application 'tilt' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "pathname"
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-bundle_binstub = File.expand_path("../bundle", __FILE__)
-
-if File.file?(bundle_binstub)
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
- load(bundle_binstub)
- else
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
-Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
- end
-end
-
-require "rubygems"
-require "bundler/setup"
-
-load Gem.bin_path("tilt", "tilt")
diff --git a/bin/update b/bin/update
new file mode 100755
index 00000000..58bfaed5
--- /dev/null
+++ b/bin/update
@@ -0,0 +1,31 @@
+#!/usr/bin/env ruby
+require 'fileutils'
+include FileUtils
+
+# path to your application root.
+APP_ROOT = File.expand_path('..', __dir__)
+
+def system!(*args)
+ system(*args) || abort("\n== Command #{args} failed ==")
+end
+
+chdir APP_ROOT do
+ # This script is a way to update your development environment automatically.
+ # Add necessary update steps to this file.
+
+ puts '== Installing dependencies =='
+ system! 'gem install bundler --conservative'
+ system('bundle check') || system!('bundle install')
+
+ # Install JavaScript dependencies if using Yarn
+ # system('bin/yarn')
+
+ puts "\n== Updating database =="
+ system! 'bin/rails db:migrate'
+
+ puts "\n== Removing old logs and tempfiles =="
+ system! 'bin/rails log:clear tmp:clear'
+
+ puts "\n== Restarting application server =="
+ system! 'bin/rails restart'
+end
diff --git a/bin/yarn b/bin/yarn
new file mode 100755
index 00000000..460dd565
--- /dev/null
+++ b/bin/yarn
@@ -0,0 +1,11 @@
+#!/usr/bin/env ruby
+APP_ROOT = File.expand_path('..', __dir__)
+Dir.chdir(APP_ROOT) do
+ begin
+ exec "yarnpkg", *ARGV
+ rescue Errno::ENOENT
+ $stderr.puts "Yarn executable was not detected in the system."
+ $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
+ exit 1
+ end
+end
From 10169800e334e9519b6d8a80a4ad42ef7db1a72e Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 22 Nov 2020 13:22:16 +0100
Subject: [PATCH 072/159] fixed bitcointalk link
---
README.md | 2 +-
README_ES.md | 2 +-
README_PT.md | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 478adcff..3bfda6b4 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@ Donate bitcoins to open source projects or receive tips for code contributions.
Name | Link
----|----|
Official site | https://tip4commit.com/
-Discussions | https://bitcointalk.org/index.php?topic=31580
+Discussions | https://bitcointalk.org/index.php?topic=315802.0
FAQs | https://github.com/tip4commit/tip4commit/wiki/FAQ
Issues | https://github.com/tip4commit/tip4commit/issues
Twitter | https://twitter.com/tip4commit
diff --git a/README_ES.md b/README_ES.md
index 883cec0b..8fc65267 100644
--- a/README_ES.md
+++ b/README_ES.md
@@ -9,7 +9,7 @@ Dona Bitcoins a proyectos de código abierto o recibe propinas contribuciones de
Nombre | Enlace
----|----|
Sitio Oficial| https://tip4commit.com/
-Discusiones| https://bitcointalk.org/index.php?topic=31580
+Discusiones| https://bitcointalk.org/index.php?topic=315802.0
Preguntas Frecuentes | https://github.com/tip4commit/tip4commit/wiki/FAQ
Problemas| https://github.com/tip4commit/tip4commit/issues
diff --git a/README_PT.md b/README_PT.md
index b285827e..b931775c 100644
--- a/README_PT.md
+++ b/README_PT.md
@@ -9,7 +9,7 @@ Doe bitcoins para projetos de código aberto ou receba gorjetas por colaborar no
Nome | Ligação
----|----|
Site oficial| https://tip4commit.com/
-Discussões | https://bitcointalk.org/index.php?topic=31580
+Discussões | https://bitcointalk.org/index.php?topic=315802.0
FAQs | https://github.com/tip4commit/tip4commit/wiki/FAQ
Problemas | https://github.com/tip4commit/tip4commit/issues
From 0ee39490bdbd513fd57be3f5fb15a3062e0854ba Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 22 Nov 2020 13:25:52 +0100
Subject: [PATCH 073/159] fixed uninitialized constant
Faraday::Error::ConnectionFailed
---
app/models/project.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/models/project.rb b/app/models/project.rb
index a984c67d..154138d7 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -183,7 +183,7 @@ def update_info
update_repository_info(repository_info)
update_collaborators(collaborators_info)
rescue Octokit::BadGateway, Octokit::NotFound, Octokit::InternalServerError, Octokit::Forbidden,
- Errno::ETIMEDOUT, Net::ReadTimeout, Faraday::Error::ConnectionFailed => e
+ Errno::ETIMEDOUT, Net::ReadTimeout, Faraday::ConnectionFailed => e
Rails.logger.info "Project ##{id}: #{e.class} happened"
rescue StandardError => e
Airbrake.notify(e)
From b3e17b5b6ca65b567469d78f7e901abb5b0fb666 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Fri, 27 Nov 2020 10:28:30 +0100
Subject: [PATCH 074/159] mitigate CVE-2015-9284
---
Gemfile | 1 +
Gemfile.lock | 4 +++
app/views/devise/shared/_links.haml | 2 +-
.../requests/cve_2005_9284_regression_spec.rb | 30 +++++++++++++++++++
4 files changed, 36 insertions(+), 1 deletion(-)
create mode 100644 spec/requests/cve_2005_9284_regression_spec.rb
diff --git a/Gemfile b/Gemfile
index ae6cf86f..f2c465e3 100644
--- a/Gemfile
+++ b/Gemfile
@@ -31,6 +31,7 @@ gem 'mysql2', group: :production
gem 'octokit'
gem 'omniauth'
gem 'omniauth-github'
+gem 'omniauth-rails_csrf_protection', '~> 0.1'
gem 'rails-i18n'
gem 'render_csv'
gem 'rest-client'
diff --git a/Gemfile.lock b/Gemfile.lock
index 8446f023..34ed5444 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -258,6 +258,9 @@ GEM
omniauth-oauth2 (1.7.0)
oauth2 (~> 1.4)
omniauth (~> 1.9)
+ omniauth-rails_csrf_protection (0.1.2)
+ actionpack (>= 4.2)
+ omniauth (>= 1.3.1)
orm_adapter (0.5.0)
parallel (1.20.0)
parser (2.7.2.0)
@@ -464,6 +467,7 @@ DEPENDENCIES
octokit
omniauth
omniauth-github
+ omniauth-rails_csrf_protection (~> 0.1)
rails (= 5.2.4.4)
rails-controller-testing
rails-i18n
diff --git a/app/views/devise/shared/_links.haml b/app/views/devise/shared/_links.haml
index 122a6754..bac403da 100644
--- a/app/views/devise/shared/_links.haml
+++ b/app/views/devise/shared/_links.haml
@@ -15,5 +15,5 @@
%br/
- if devise_mapping.omniauthable?
- resource_class.omniauth_providers.each do |provider|
- = link_to t('devise.links.sign_in_with', provider: provider.to_s.titleize), omniauth_authorize_path(resource_name, provider)
+ = link_to t('devise.links.sign_in_with', provider: provider.to_s.titleize), omniauth_authorize_path(resource_name, provider), method: :post
%br/
diff --git a/spec/requests/cve_2005_9284_regression_spec.rb b/spec/requests/cve_2005_9284_regression_spec.rb
new file mode 100644
index 00000000..6d6b82ea
--- /dev/null
+++ b/spec/requests/cve_2005_9284_regression_spec.rb
@@ -0,0 +1,30 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+# Make sure that https://nvd.nist.gov/vuln/detail/CVE-2015-9284 is mitigated
+describe 'CVE-2015-9284', type: :request do
+ describe 'GET /auth/:provider' do
+ it do
+ get '/users/auth/github'
+ expect(response).not_to have_http_status(:redirect)
+ end
+ end
+
+ describe 'POST /auth/:provider without CSRF token' do
+ before do
+ @allow_forgery_protection = ActionController::Base.allow_forgery_protection
+ ActionController::Base.allow_forgery_protection = true
+ end
+
+ it do
+ expect do
+ post '/users/auth/github'
+ end.to raise_error(ActionController::InvalidAuthenticityToken)
+ end
+
+ after do
+ ActionController::Base.allow_forgery_protection = @allow_forgery_protection
+ end
+ end
+end
From d1354ba206b3a842935b7e4ed2dee474890af254 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Fri, 27 Nov 2020 14:19:51 +0100
Subject: [PATCH 075/159] fixed rubocop warnings
---
.rubocop_todo.yml | 16 ++++---------
app/controllers/application_controller.rb | 29 ++++++++++-------------
app/controllers/projects_controller.rb | 17 +++++++------
app/services/github.rb | 25 +++++++++----------
4 files changed, 38 insertions(+), 49 deletions(-)
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 89ff7e02..88bc7f47 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -1,19 +1,11 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
-# on 2020-11-22 09:26:39 UTC using RuboCop version 1.3.1.
+# on 2020-11-27 13:19:11 UTC using RuboCop version 1.3.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
-# Offense count: 3
-# Configuration parameters: AllowSafeAssignment.
-Lint/AssignmentInCondition:
- Exclude:
- - 'app/controllers/application_controller.rb'
- - 'app/controllers/projects_controller.rb'
- - 'app/services/github.rb'
-
# Offense count: 1
# Configuration parameters: AllowComments, AllowEmptyLambdas.
Lint/EmptyBlock:
@@ -44,7 +36,7 @@ Lint/UselessAssignment:
- 'app/models/user.rb'
- 'features/step_definitions/common.rb'
-# Offense count: 20
+# Offense count: 18
# Configuration parameters: IgnoredMethods.
Metrics/AbcSize:
Max: 67
@@ -65,7 +57,7 @@ Metrics/ClassLength:
Metrics/CyclomaticComplexity:
Max: 29
-# Offense count: 25
+# Offense count: 23
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
Metrics/MethodLength:
Max: 56
@@ -130,7 +122,7 @@ Style/FormatString:
Exclude:
- 'app/helpers/projects_helper.rb'
-# Offense count: 9
+# Offense count: 8
# Configuration parameters: MinBodyLength.
Style/GuardClause:
Exclude:
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index be20945d..b27a2bdd 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -14,24 +14,21 @@ class ApplicationController < ActionController::Base
private
def load_locale
- if params[:locale] && ::Rails.application.config.available_locales.include?(params[:locale])
- I18n.locale = session[:locale] = params[:locale].to_sym
- begin
- redirect_to :back
- rescue StandardError
- true
- end
- elsif session[:locale]
- I18n.locale = session[:locale]
- elsif l = language_from_http_accept_language
- I18n.locale = session[:locale] = l
- end
+ locale = locale_from_params || session[:locale] || locale_from_http_accept_language
+ I18n.locale = session[:locale] = locale
+
+ redirect_back(fallback_location: root_path) if params[:locale].present?
+ end
+
+ def locale_from_params
+ return unless params[:locale]
+ return unless ::Rails.application.config.available_locales.include?(params[:locale])
+
+ params[:locale].to_sym
end
- def language_from_http_accept_language
- http_accept_language.compatible_language_from(::Rails.application.config.available_locales).to_sym
- rescue StandardError
- nil
+ def locale_from_http_accept_language
+ http_accept_language.compatible_language_from(::Rails.application.config.available_locales)&.to_sym
end
def load_project(params)
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 457236e2..6762a954 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -13,16 +13,15 @@ def index
end
def search
- if params[:query].present?
- if BLACKLIST.include?(params[:query])
- render :blacklisted and return
- elsif project = Project.find_by_url(params[:query])
- redirect_to pretty_project_path(project) and return
- end
- end
+ query = params[:query] || ''
+
+ return render(:blacklisted) if BLACKLIST.include?(query)
+
+ project = Project.find_by_url(query)
+ return redirect_to(pretty_project_path(project)) if project
- @projects = Project.search(params[:query].to_s).order(projects_order).page(params[:page]).per(30)
- render :index
+ @projects = Project.search(query).order(projects_order).page(params[:page]).per(30)
+ render(:index)
end
def show
diff --git a/app/services/github.rb b/app/services/github.rb
index 073f4c22..302a02b5 100644
--- a/app/services/github.rb
+++ b/app/services/github.rb
@@ -48,24 +48,25 @@ def repository_info(project)
end
def find_or_create_project(project_name)
- if project = find_project(project_name)
- project
- elsif project_name =~ %r{\w+/\w+}
- begin
- repo = repository_info project_name
- project = Project.find_or_create_by host: 'github', full_name: repo.full_name
- project.update_repository_info repo
- project
- rescue Octokit::NotFound
- nil
- end
- end
+ find_project(project_name) || create_project(project_name)
end
def find_project(project_name)
Project.find_by(host: 'github', full_name: project_name)
end
+ def create_project(project_name)
+ project_name =~ %r{\w+/\w+}
+ return unless project_name
+
+ repo = repository_info(project_name)
+ project = Project.find_or_create_by(host: 'github', full_name: repo.full_name)
+ project.update_repository_info(repo)
+ project
+ rescue Octokit::NotFound
+ nil
+ end
+
def collaborators_info(project)
begin
client.get("/repos/#{project.full_name}/collaborators").map(&:login)
From 4d54b574f726ce4300e33e05b5c55c885c2d38e8 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Fri, 27 Nov 2020 17:38:44 +0100
Subject: [PATCH 076/159] rubocop fixes
---
.rubocop_todo.yml | 46 ++------------------------
app/controllers/projects_controller.rb | 21 +++++-------
app/controllers/users_controller.rb | 13 +++-----
app/models/project.rb | 2 +-
app/models/user.rb | 4 +--
app/views/projects/show.html.haml | 4 +--
features/step_definitions/common.rb | 10 ++----
lib/bitcoin_address_validator.rb | 6 ++--
lib/bitcoin_rpc.rb | 6 +---
lib/tasks/cucumber.rake | 3 +-
10 files changed, 30 insertions(+), 85 deletions(-)
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 88bc7f47..1e374245 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -1,41 +1,16 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
-# on 2020-11-27 13:19:11 UTC using RuboCop version 1.3.1.
+# on 2020-11-27 16:36:50 UTC using RuboCop version 1.3.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
-# Offense count: 1
-# Configuration parameters: AllowComments, AllowEmptyLambdas.
-Lint/EmptyBlock:
- Exclude:
- - 'lib/tasks/cucumber.rake'
-
# Offense count: 1
Lint/MissingSuper:
Exclude:
- 'lib/bitcoin_rpc.rb'
-# Offense count: 2
-# Configuration parameters: AllowComments.
-Lint/SuppressedException:
- Exclude:
- - 'app/controllers/projects_controller.rb'
- - 'app/controllers/users_controller.rb'
-
-# Offense count: 1
-Lint/UriEscapeUnescape:
- Exclude:
- - 'features/step_definitions/common.rb'
-
-# Offense count: 4
-Lint/UselessAssignment:
- Exclude:
- - 'app/models/project.rb'
- - 'app/models/user.rb'
- - 'features/step_definitions/common.rb'
-
# Offense count: 18
# Configuration parameters: IgnoredMethods.
Metrics/AbcSize:
@@ -57,7 +32,7 @@ Metrics/ClassLength:
Metrics/CyclomaticComplexity:
Max: 29
-# Offense count: 23
+# Offense count: 22
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
Metrics/MethodLength:
Max: 56
@@ -72,23 +47,6 @@ Metrics/ModuleLength:
Metrics/PerceivedComplexity:
Max: 31
-# Offense count: 1
-Naming/AccessorMethodName:
- Exclude:
- - 'lib/bitcoin_rpc.rb'
-
-# Offense count: 1
-Naming/ConstantName:
- Exclude:
- - 'lib/bitcoin_address_validator.rb'
-
-# Offense count: 1
-# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
-# AllowedNames: at, by, db, id, in, io, ip, of, on, os, pp, to
-Naming/MethodParameterName:
- Exclude:
- - 'lib/bitcoin_rpc.rb'
-
# Offense count: 1
# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros.
# NamePrefix: is_, has_, have_
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 6762a954..725c223e 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -91,19 +91,16 @@ def projects_order
def redirect_to_pretty_url
return unless request.get? && params[:id].present?
- begin
- respond_to do |format|
- case action_name
- when 'show'
- path = pretty_project_path @project
- when 'edit'
- path = pretty_project_edit_path @project
- when 'decide_tip_amounts'
- path = pretty_project_decide_tip_amounts_path @project
- end
- format.html { redirect_to path }
+ respond_to do |format|
+ case action_name
+ when 'show'
+ path = pretty_project_path(@project)
+ when 'edit'
+ path = pretty_project_edit_path(@project)
+ when 'decide_tip_amounts'
+ path = pretty_project_decide_tip_amounts_path(@project)
end
- rescue ActionController::UnknownFormat
+ format.html { redirect_to path }
end
end
end
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index e871bf9e..07c4e987 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -66,15 +66,12 @@ def valid_user!
def redirect_to_pretty_url
return unless request.get? && params[:id].present? && @user.nickname.present?
- begin
- respond_to do |format|
- case action_name
- when 'show'
- path = user_pretty_path @user.nickname
- end
- format.html { redirect_to path }
+ respond_to do |format|
+ case action_name
+ when 'show'
+ path = user_pretty_path @user.nickname
end
- rescue ActionController::UnknownFormat
+ format.html { redirect_to path }
end
end
end
diff --git a/app/models/project.rb b/app/models/project.rb
index 154138d7..7dc30182 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -168,7 +168,7 @@ def tips_paid_unclaimed_amount
def next_tip_amount
next_tip_amount = (CONFIG['tip'] * available_amount).ceil
next_tip_amount = [next_tip_amount, CONFIG['min_tip']].max if CONFIG['min_tip']
- next_tip_amount = [next_tip_amount, available_amount].min
+ [next_tip_amount, available_amount].min
end
def update_cache
diff --git a/app/models/user.rb b/app/models/user.rb
index 30cdf25e..04953db2 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -32,13 +32,13 @@ def denom
def gravatar_bitcoin
gravatar.get_value :currency, :bitcoin
- rescue URI::InvalidURIError, NoMethodError => e
+ rescue URI::InvalidURIError, NoMethodError
nil
end
def gravatar_display_name
gravatar.get_value :displayName
- rescue URI::InvalidURIError, NoMethodError => e
+ rescue URI::InvalidURIError, NoMethodError
nil
end
diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml
index ff1f2424..ccbab702 100644
--- a/app/views/projects/show.html.haml
+++ b/app/views/projects/show.html.haml
@@ -15,9 +15,9 @@
.pull-right
- if @project.collaborators.empty?
= t('.fetch_pending')
- - if can? :update, @project
+ - if can?(:update, @project)
= link_to t('.edit_project'), pretty_project_edit_path(@project), class: "btn btn-primary"
- - if can? :decide_tip_amounts, @project and @project.has_undecided_tips?
+ - if can?(:decide_tip_amounts, @project) && @project.has_undecided_tips?
= link_to t('.decide_tip_amounts'), pretty_project_decide_tip_amounts_path(@project), class: "btn btn-warning"
.row
diff --git a/features/step_definitions/common.rb b/features/step_definitions/common.rb
index 07d7f228..03a29c01 100644
--- a/features/step_definitions/common.rb
+++ b/features/step_definitions/common.rb
@@ -102,7 +102,7 @@ def parse_path_from_page_string(page_string)
end
end
- path || (raise 'unknown page')
+ path || page_string
end
Given(/^I visit the "(.*?)" page$/) do |page_string|
@@ -114,12 +114,8 @@ def parse_path_from_page_string(page_string)
end
Then(/^I should be on the "(.*?)" page$/) do |page_string|
- expected = begin
- parse_path_from_page_string(page_string)
- rescue StandardError
- expected = page_string
- end
- actual = URI.decode(page.current_path)
+ expected = parse_path_from_page_string(page_string)
+ actual = CGI.unescape(page.current_path)
expected = expected.chop if (expected.end_with? '/') && (expected.size > 1)
actual = actual.chop if (actual.end_with? '/') && (actual.size > 1)
diff --git a/lib/bitcoin_address_validator.rb b/lib/bitcoin_address_validator.rb
index 5b0bbd25..577a0f59 100644
--- a/lib/bitcoin_address_validator.rb
+++ b/lib/bitcoin_address_validator.rb
@@ -33,8 +33,8 @@ def parse_segwit_address(addr)
raise
end
- B58Chars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
- B58Base = B58Chars.length
+ B58_CHARS = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
+ B58_BASE = B58_CHARS.length
EXPECTED_VERSIONS = {
mainnet: [0, 5],
@@ -71,7 +71,7 @@ def b58_decode(value, length)
result = ''
value.reverse.each_char do |c|
- long_value += B58Chars.index(c) * (B58Base**index)
+ long_value += B58_CHARS.index(c) * (B58_BASE**index)
index += 1
end
diff --git a/lib/bitcoin_rpc.rb b/lib/bitcoin_rpc.rb
index c245984a..e7591205 100644
--- a/lib/bitcoin_rpc.rb
+++ b/lib/bitcoin_rpc.rb
@@ -8,11 +8,7 @@ class BitcoinRPC
def initialize(service_url, batch_mode = false)
@service_url = service_url
@uri = URI.parse(service_url)
- set_batch_mode(batch_mode)
- end
-
- def set_batch_mode(m)
- @batch_mode = m
+ @batch_mode = batch_mode
end
def method_missing(name, *args)
diff --git a/lib/tasks/cucumber.rake b/lib/tasks/cucumber.rake
index dcf14d1a..4d81c9d1 100644
--- a/lib/tasks/cucumber.rake
+++ b/lib/tasks/cucumber.rake
@@ -51,8 +51,9 @@ unless ARGV.any? { |a| a =~ /^gems/ } # Don't load anything when running the gem
warn "*** The 'features' task is deprecated. See rake -T cucumber ***"
end
- # In case we don't have the generic Rails test:prepare hook, append a no-op task that we can depend upon.
task 'test:prepare' do
+ # In case we don't have the generic Rails test:prepare hook,
+ # append a no-op task that we can depend upon.
end
task stats: 'cucumber:statsetup'
From b21e5266412ff6fbddeffd518525f6f576140de6 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Fri, 27 Nov 2020 20:12:55 +0100
Subject: [PATCH 077/159] removed tip notification mailer + fixed rubocop
warnings
---
.rubocop_todo.yml | 62 +++----------------
app/helpers/projects_helper.rb | 2 +-
app/mailers/user_mailer.rb | 18 ------
app/models/project.rb | 4 +-
app/models/sendmany.rb | 2 +-
app/models/tip.rb | 20 ------
.../check_bitcoin_address.html.haml | 14 -----
app/views/user_mailer/new_tip.html.haml | 20 ------
features/step_definitions/home_steps.rb | 8 ++-
features/step_definitions/project_steps.rb | 28 ++++-----
features/step_definitions/tips_steps.rb | 2 +-
lib/bitcoin_rpc.rb | 2 +-
lib/bitcoin_tipper.rb | 2 +-
spec/mailers/user_mailer_spec.rb | 49 ---------------
14 files changed, 35 insertions(+), 198 deletions(-)
delete mode 100644 app/mailers/user_mailer.rb
delete mode 100644 app/views/user_mailer/check_bitcoin_address.html.haml
delete mode 100644 app/views/user_mailer/new_tip.html.haml
delete mode 100644 spec/mailers/user_mailer_spec.rb
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 1e374245..5f2ca7d7 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
-# on 2020-11-27 16:36:50 UTC using RuboCop version 1.3.1.
+# on 2020-11-27 19:10:13 UTC using RuboCop version 1.3.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
@@ -11,12 +11,12 @@ Lint/MissingSuper:
Exclude:
- 'lib/bitcoin_rpc.rb'
-# Offense count: 18
+# Offense count: 17
# Configuration parameters: IgnoredMethods.
Metrics/AbcSize:
Max: 67
-# Offense count: 19
+# Offense count: 17
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
# ExcludedMethods: refine
Metrics/BlockLength:
@@ -25,14 +25,14 @@ Metrics/BlockLength:
# Offense count: 2
# Configuration parameters: CountComments, CountAsOne.
Metrics/ClassLength:
- Max: 183
+ Max: 181
-# Offense count: 7
+# Offense count: 6
# Configuration parameters: IgnoredMethods.
Metrics/CyclomaticComplexity:
Max: 29
-# Offense count: 22
+# Offense count: 21
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
Metrics/MethodLength:
Max: 56
@@ -42,7 +42,7 @@ Metrics/MethodLength:
Metrics/ModuleLength:
Max: 162
-# Offense count: 7
+# Offense count: 6
# Configuration parameters: IgnoredMethods.
Metrics/PerceivedComplexity:
Max: 31
@@ -58,13 +58,6 @@ Naming/PredicateName:
- 'spec/**/*'
- 'app/models/project.rb'
-# Offense count: 3
-# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers.
-# SupportedStyles: snake_case, normalcase, non_integer
-Naming/VariableNumber:
- Exclude:
- - 'features/step_definitions/project_steps.rb'
-
# Offense count: 23
# Cop supports --auto-correct.
# Configuration parameters: AllowOnConstant.
@@ -72,15 +65,7 @@ Style/CaseEquality:
Exclude:
- 'app/helpers/application_helper.rb'
-# Offense count: 1
-# Cop supports --auto-correct.
-# Configuration parameters: EnforcedStyle.
-# SupportedStyles: format, sprintf, percent
-Style/FormatString:
- Exclude:
- - 'app/helpers/projects_helper.rb'
-
-# Offense count: 8
+# Offense count: 7
# Configuration parameters: MinBodyLength.
Style/GuardClause:
Exclude:
@@ -91,41 +76,12 @@ Style/GuardClause:
- 'app/models/project.rb'
- 'app/models/tip.rb'
-# Offense count: 1
-# Cop supports --auto-correct.
-Style/IfUnlessModifier:
- Exclude:
- - 'app/models/project.rb'
-
# Offense count: 1
Style/MissingRespondToMissing:
Exclude:
- 'lib/bitcoin_rpc.rb'
-# Offense count: 3
-# Configuration parameters: AllowedMethods.
-# AllowedMethods: respond_to_missing?
-Style/OptionalBooleanParameter:
- Exclude:
- - 'features/step_definitions/project_steps.rb'
- - 'lib/bitcoin_rpc.rb'
- - 'lib/bitcoin_tipper.rb'
-
-# Offense count: 1
-# Configuration parameters: AllowModifier.
-Style/SoleNestedConditional:
- Exclude:
- - 'app/models/tip.rb'
-
-# Offense count: 1
-# Cop supports --auto-correct.
-# Configuration parameters: EnforcedStyle, AllowSafeAssignment.
-# SupportedStyles: require_parentheses, require_no_parentheses, require_parentheses_when_complex
-Style/TernaryParentheses:
- Exclude:
- - 'features/step_definitions/home_steps.rb'
-
-# Offense count: 24
+# Offense count: 25
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index c8e38e03..349739be 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -3,7 +3,7 @@
module ProjectsHelper
def shield_btc_amount(amount)
btc_amount = amount / 1e8
- "%.#{9 - btc_amount.to_i.to_s.length}f Ƀ" % btc_amount
+ format("%.#{9 - btc_amount.to_i.to_s.length}f Ƀ", btc_amount)
end
def shield_color(project)
diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb
deleted file mode 100644
index 74fc2f68..00000000
--- a/app/mailers/user_mailer.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class UserMailer < ActionMailer::Base
- add_template_helper(ApplicationHelper)
-
- def new_tip(user, tip)
- @user = user
- @tip = tip
-
- mail to: user.email, subject: 'You received a tip for your commit'
- end
-
- def check_bitcoin_address(user)
- @user = user
-
- mail to: user.email, subject: 'Check your Bitcoin address'
- end
-end
diff --git a/app/models/project.rb b/app/models/project.rb
index 7dc30182..5a75e007 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -202,9 +202,7 @@ def commit_url(commit)
end
def check_tips_to_pay_against_avaiable_amount
- if available_amount.negative?
- raise "Not enough funds to pay the pending tips on #{inspect} (#{available_amount} < 0)"
- end
+ raise "Not enough funds to pay the pending tips on #{inspect} (#{available_amount} < 0)" if available_amount.negative?
end
def self.find_or_create_by_url(project_url)
diff --git a/app/models/sendmany.rb b/app/models/sendmany.rb
index 67a020e5..76eab0ca 100644
--- a/app/models/sendmany.rb
+++ b/app/models/sendmany.rb
@@ -12,7 +12,7 @@ def send_transaction
update_attribute :is_error, true # it's a lock to prevent duplicates
- bitcoind = BitcoinRPC.new(CONFIG['bitcoind']['rpc_connection_string'], false)
+ bitcoind = BitcoinRPC.new(CONFIG['bitcoind']['rpc_connection_string'], batch_mode: false)
begin
txid = bitcoind.sendmany(
diff --git a/app/models/tip.rb b/app/models/tip.rb
index f80c234b..e243c244 100644
--- a/app/models/tip.rb
+++ b/app/models/tip.rb
@@ -89,7 +89,6 @@ def undecided?
before_save :check_amount_against_project
before_save :touch_decided_at_if_decided
- after_save :notify_user_if_just_decided
def self.refund_unclaimed
unclaimed.non_refunded
@@ -125,25 +124,6 @@ def amount_percentage=(percentage)
self.amount = (project.available_amount * (percentage.to_f / 100)).ceil
end
- def notify_user
- if amount&.positive? && user.bitcoin_address.blank? &&
- !user.unsubscribed && !project.disable_notifications &&
- user.balance > 21_000_000 * 1e8
- if user.notified_at.nil? || (user.notified_at < 30.days.ago)
- begin
- UserMailer.new_tip(user, self).deliver
- user.touch :notified_at
- rescue Net::SMTPServerBusy => e
- Rails.logger.info "Error: #{e.class}: #{e.message}"
- end
- end
- end
- end
-
- def notify_user_if_just_decided
- notify_user if amount_was.nil? && amount
- end
-
def check_amount_against_project
if amount && amount_changed?
available_amount = project.available_amount
diff --git a/app/views/user_mailer/check_bitcoin_address.html.haml b/app/views/user_mailer/check_bitcoin_address.html.haml
deleted file mode 100644
index 4a7ae264..00000000
--- a/app/views/user_mailer/check_bitcoin_address.html.haml
+++ /dev/null
@@ -1,14 +0,0 @@
-%h4 Hello, #{@user.display_name}!
-
-%p Recently, we discovered a security breach in our system and it's possible that someone changed your Bitcoin address. Please check it:
-
-%p
- %strong= @user.bitcoin_address
-
-%p
- If this address is not yours, please
- = link_to 'update it', login_users_url(token: @user.login_token)
-
-%p Thank you for contributing to Open Source and sorry for troubles!
-
-%p= link_to "tip4commit.com", "http://tip4commit.com/"
\ No newline at end of file
diff --git a/app/views/user_mailer/new_tip.html.haml b/app/views/user_mailer/new_tip.html.haml
deleted file mode 100644
index b86b4a8a..00000000
--- a/app/views/user_mailer/new_tip.html.haml
+++ /dev/null
@@ -1,20 +0,0 @@
-%h4 Hello, #{@user.display_name}!
-
-%p You were tipped #{btc_human @tip.amount} for your commit on Project #{@tip.project.full_name}. Please, log in and tell us your bitcoin address to get it.
-
-%p Your current balance is #{btc_human @user.balance}. If you don't enter a bitcoin address your tips will be returned to the project in 30 days.
-
-%p If you don't need bitcoins you can redirect your funds to #{link_to 'Free Software Foundation', 'https://www.fsf.org/about/ways-to-donate'}.
-
-%p= link_to 'Sign In', login_users_url(token: @user.login_token)
-
-%p Thanks for contributing to Open Source!
-
-%p= link_to "tip4commit.com", "https://tip4commit.com/"
-
-%p
- %small
- = link_to "Don't notify me anymore, I don't need tips.", login_users_url(token: @user.login_token, unsubscribe: true)
-
-
-.alert.alert-warning We are not affiliated with most of the projects, their owners might not endorse use of tip4commit.
diff --git a/features/step_definitions/home_steps.rb b/features/step_definitions/home_steps.rb
index 0ec0493e..e802c127 100644
--- a/features/step_definitions/home_steps.rb
+++ b/features/step_definitions/home_steps.rb
@@ -1,6 +1,10 @@
# frozen_string_literal: true
-Then(/^I should (.*)\s*see "(.*?)" in the "(.*?)" area$/) do |should, text, node_name|
+Then(/^I should ((not)?)\s*see "(.*?)" in the "(.*?)" area$/) do |should, text, node_name|
element = find_element node_name
- element.should((should.eql? 'not ') ? (have_no_content text) : (have_content text))
+ if should == 'not'
+ element.should have_no_content text
+ else
+ element.should have_content text
+ end
end
diff --git a/features/step_definitions/project_steps.rb b/features/step_definitions/project_steps.rb
index b4e23624..51a07648 100644
--- a/features/step_definitions/project_steps.rb
+++ b/features/step_definitions/project_steps.rb
@@ -1,14 +1,14 @@
# frozen_string_literal: true
def github_projects
- [@github_project_1, @github_project_2, @github_project_3].compact
+ [@github_project1, @github_project2, @github_project3].compact
end
def bitbucket_projects
- [@bitbucket_project_1, @bitbucket_project_2, @bitbucket_project_3].compact
+ [@bitbucket_project1, @bitbucket_project2, @bitbucket_project3].compact
end
-def create_github_project(project_name, is_mock_project = true)
+def create_github_project(project_name, is_mock_project: true)
# NOTE: when is_mock_project is false the app will actually fetch via network
# this is the old "find or create" GUI functionality
# so obviously the actual repo must exist
@@ -17,10 +17,10 @@ def create_github_project(project_name, is_mock_project = true)
# source_full_name , description , watchers_count , language
# up to three of each host are cached with a reference to the most recent
- if (@github_project_1.present? && (project_name.eql? @github_project_1.full_name)) ||
- (@github_project_2.present? && (project_name.eql? @github_project_2.full_name))
+ if (@github_project1.present? && (project_name.eql? @github_project1.full_name)) ||
+ (@github_project2.present? && (project_name.eql? @github_project2.full_name))
raise "duplicate project_name '#{project_name}'"
- elsif @github_project_3.present?
+ elsif @github_project3.present?
raise 'the maximum of three test projects already exist'
end
@@ -35,12 +35,12 @@ def create_github_project(project_name, is_mock_project = true)
end
unless github_projects.include?(new_project)
- if @github_project_2.present?
- @github_project_3 = new_project
- elsif @github_project_1.present?
- @github_project_2 = new_project
+ if @github_project2.present?
+ @github_project3 = new_project
+ elsif @github_project1.present?
+ @github_project2 = new_project
else
- @github_project_1 = new_project
+ @github_project1 = new_project
end
end
@@ -62,11 +62,11 @@ def find_project(service, project_name)
# @current_project is also assigned in step 'regarding the "..." project named "..."'
case provider.downcase
when 'github'
- @current_project = create_github_project project_name
+ @current_project = create_github_project(project_name)
when 'bitbucket'
- @current_project = create_bitbicket_project project_name
+ @current_project = create_bitbicket_project(project_name)
when 'real-github'
- @current_project = create_github_project project_name, false
+ @current_project = create_github_project(project_name, is_mock_project: false)
else raise "unknown provider \"#{provider}\""
end
end
diff --git a/features/step_definitions/tips_steps.rb b/features/step_definitions/tips_steps.rb
index 06211d4a..fd2b307d 100644
--- a/features/step_definitions/tips_steps.rb
+++ b/features/step_definitions/tips_steps.rb
@@ -91,7 +91,7 @@ def find_new_commit(commit_id)
When(/^the new commits are loaded$/) do
raise 'no commits have been assigned' if @new_commits.nil?
- [@github_project_1, @github_project_2, @github_project_3].each do |project|
+ [@github_project1, @github_project2, @github_project3].each do |project|
next if project.nil?
project.reload
diff --git a/lib/bitcoin_rpc.rb b/lib/bitcoin_rpc.rb
index e7591205..e58eb3af 100644
--- a/lib/bitcoin_rpc.rb
+++ b/lib/bitcoin_rpc.rb
@@ -5,7 +5,7 @@
require 'json'
class BitcoinRPC
- def initialize(service_url, batch_mode = false)
+ def initialize(service_url, batch_mode: false)
@service_url = service_url
@uri = URI.parse(service_url)
@batch_mode = batch_mode
diff --git a/lib/bitcoin_tipper.rb b/lib/bitcoin_tipper.rb
index a6883584..10506a6c 100644
--- a/lib/bitcoin_tipper.rb
+++ b/lib/bitcoin_tipper.rb
@@ -8,7 +8,7 @@ def work_forever
end
end
- def work(withdraw = true)
+ def work(withdraw: true)
create_tips
update_projects_info
check_and_withdrawal_funds if withdraw
diff --git a/spec/mailers/user_mailer_spec.rb b/spec/mailers/user_mailer_spec.rb
deleted file mode 100644
index db1338d0..00000000
--- a/spec/mailers/user_mailer_spec.rb
+++ /dev/null
@@ -1,49 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-describe UserMailer do
- describe 'new_tip' do
- let(:user) do
- mock_model(
- User,
- name: 'kd',
- email: 'kd.engineer@yahoo.co.in',
- display_name: 'kuldeep aggarwal',
- login_token: 'my login token',
- balance: 10
- )
- end
- let(:project) { mock_model Project, full_name: 'logger-extension' }
- let(:tip) { mock_model Tip, amount: 0.0001, project: project }
- let(:mail) { UserMailer.new_tip(user, tip) }
-
- it 'renders the subject' do
- expect(mail.subject).to eq 'You received a tip for your commit'
- end
-
- it 'renders the receiver email' do
- expect(mail.to).to eq [user.email]
- end
-
- it 'renders the sender email' do
- expect(mail.from).to eq ['no-reply@tip4commit.com']
- end
-
- it 'assigns user\'s display_name' do
- expect(mail.body.encoded).to match(user.display_name)
- end
-
- it 'assigns users\' balance' do
- expected_text = [
- 'Please, log in and tell us your bitcoin address to get it.
',
- 'Your current balance is 0.00000010 Ƀ'
- ].join("\r\n")
- expect(mail.body.encoded).to match expected_text
- end
-
- it 'useses secure protocol for links' do
- expect(mail.body.encoded).to match('https')
- end
- end
-end
From 38098665f5011b6e6ec4060a9e434b625b9e130d Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sat, 28 Nov 2020 08:56:18 +0100
Subject: [PATCH 078/159] fixed rubocop warnings
---
.rubocop_todo.yml | 32 +++----------
app/controllers/application_controller.rb | 16 +++----
app/controllers/projects_controller.rb | 36 +++++++-------
.../users/omniauth_callbacks_controller.rb | 8 ++--
app/controllers/users_controller.rb | 8 ++--
app/helpers/application_helper.rb | 47 ++++++++++---------
app/models/project.rb | 34 +++++++-------
app/models/tip.rb | 15 +++---
8 files changed, 91 insertions(+), 105 deletions(-)
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 5f2ca7d7..fc4d08eb 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
-# on 2020-11-27 19:10:13 UTC using RuboCop version 1.3.1.
+# on 2020-11-28 07:55:00 UTC using RuboCop version 1.3.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
@@ -14,7 +14,7 @@ Lint/MissingSuper:
# Offense count: 17
# Configuration parameters: IgnoredMethods.
Metrics/AbcSize:
- Max: 67
+ Max: 51
# Offense count: 17
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
@@ -25,7 +25,7 @@ Metrics/BlockLength:
# Offense count: 2
# Configuration parameters: CountComments, CountAsOne.
Metrics/ClassLength:
- Max: 181
+ Max: 184
# Offense count: 6
# Configuration parameters: IgnoredMethods.
@@ -35,17 +35,17 @@ Metrics/CyclomaticComplexity:
# Offense count: 21
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
Metrics/MethodLength:
- Max: 56
+ Max: 57
# Offense count: 1
# Configuration parameters: CountComments, CountAsOne.
Metrics/ModuleLength:
- Max: 162
+ Max: 163
# Offense count: 6
# Configuration parameters: IgnoredMethods.
Metrics/PerceivedComplexity:
- Max: 31
+ Max: 20
# Offense count: 1
# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros.
@@ -58,24 +58,6 @@ Naming/PredicateName:
- 'spec/**/*'
- 'app/models/project.rb'
-# Offense count: 23
-# Cop supports --auto-correct.
-# Configuration parameters: AllowOnConstant.
-Style/CaseEquality:
- Exclude:
- - 'app/helpers/application_helper.rb'
-
-# Offense count: 7
-# Configuration parameters: MinBodyLength.
-Style/GuardClause:
- Exclude:
- - 'app/controllers/application_controller.rb'
- - 'app/controllers/projects_controller.rb'
- - 'app/controllers/users/omniauth_callbacks_controller.rb'
- - 'app/controllers/users_controller.rb'
- - 'app/models/project.rb'
- - 'app/models/tip.rb'
-
# Offense count: 1
Style/MissingRespondToMissing:
Exclude:
@@ -86,4 +68,4 @@ Style/MissingRespondToMissing:
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Layout/LineLength:
- Max: 238
+ Max: 234
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index b27a2bdd..3beb1947 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -54,10 +54,10 @@ def load_project(params)
.where('lower(`full_name`) = ?', params[:repo].downcase).first
end
- if @project.nil?
- flash[:error] = I18n.t('errors.project_not_found')
- redirect_to projects_path
- end
+ return if @project.present?
+
+ flash[:error] = I18n.t('errors.project_not_found')
+ redirect_to projects_path
end
def load_user(params)
@@ -77,9 +77,9 @@ def load_user(params)
@user = User.where('lower(`nickname`) = ?', params[:nickname].downcase).first
end
- if @user.nil?
- flash[:error] = I18n.t('errors.user_not_found')
- redirect_to users_path
- end
+ return if @user.present?
+
+ flash[:error] = I18n.t('errors.user_not_found')
+ redirect_to users_path
end
end
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 725c223e..f18bc9f3 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -48,24 +48,24 @@ def update
def decide_tip_amounts
authorize! :decide_tip_amounts, @project
- if request.patch?
- @project.available_amount # preload anything required to get the amount, otherwise it's loaded during the assignation and there are undesirable consequences
- percentages = params[:project][:tips_attributes].values.map { |tip| tip['amount_percentage'].to_f }
- if percentages.sum > 100
- redirect_to decide_tip_amounts_project_path(@project), alert: I18n.t('errors.can_assign_more_tips')
- return
- end
- raise 'wrong data' if percentages.min.negative?
-
- @project.attributes = params.require(:project).permit(tips_attributes: %i[id amount_percentage])
- if @project.save
- message = I18n.t('notices.tips_decided')
- if @project.has_undecided_tips?
- redirect_to decide_tip_amounts_project_path(@project), notice: message
- else
- redirect_to @project, notice: message
- end
- end
+ return unless request.patch?
+
+ @project.available_amount # preload anything required to get the amount, otherwise it's loaded during the assignation and there are undesirable consequences
+ percentages = params[:project][:tips_attributes].values.map { |tip| tip['amount_percentage'].to_f }
+ if percentages.sum > 100
+ redirect_to decide_tip_amounts_project_path(@project), alert: I18n.t('errors.can_assign_more_tips')
+ return
+ end
+ raise 'wrong data' if percentages.min.negative?
+
+ @project.attributes = params.require(:project).permit(tips_attributes: %i[id amount_percentage])
+ return unless @project.save
+
+ message = I18n.t('notices.tips_decided')
+ if @project.has_undecided_tips?
+ redirect_to decide_tip_amounts_project_path(@project), notice: message
+ else
+ redirect_to @project, notice: message
end
end
diff --git a/app/controllers/users/omniauth_callbacks_controller.rb b/app/controllers/users/omniauth_callbacks_controller.rb
index fe2ccad5..ca40bf05 100644
--- a/app/controllers/users/omniauth_callbacks_controller.rb
+++ b/app/controllers/users/omniauth_callbacks_controller.rb
@@ -30,10 +30,10 @@ def github
def load_omniauth_info
@omniauth_info = request.env['omniauth.auth']['info']
- unless @omniauth_info
- set_flash_message(:error, :failure, kind: 'GitHub', reason: I18n.t('devise.errors.omniauth_info'))
- redirect_to new_user_session_path and return
- end
+ return if @omniauth_info
+
+ set_flash_message(:error, :failure, kind: 'GitHub', reason: I18n.t('devise.errors.omniauth_info'))
+ redirect_to new_user_session_path
end
end
end
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 07c4e987..386b627f 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -57,10 +57,10 @@ def load_user
end
def valid_user!
- if current_user != @user
- flash[:error] = I18n.t('errors.access_denied')
- redirect_to root_path and return
- end
+ return if current_user == @user
+
+ flash[:error] = I18n.t('errors.access_denied')
+ redirect_to root_path
end
def redirect_to_pretty_url
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 3f3261ad..67b38124 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -9,51 +9,52 @@ def btc_human(amount, options = {})
else
(try(:current_user) ? current_user.denom : 0)
end
- if denom === 0
+ case denom
+ when 0
btc = to_btc(amount)
- elsif denom === 1
+ when 1
btc = to_mbtc(amount)
- elsif denom === 2
+ when 2
btc = to_ubtc(amount)
- elsif denom === 3
+ when 3
btc = to_satoshi(amount)
- elsif denom === 4
+ when 4
btc = to_usd(amount)
- elsif denom === 5
+ when 5
btc = to_eur(amount)
- elsif denom === 6
+ when 6
btc = to_aud(amount)
- elsif denom === 7
+ when 7
btc = to_brl(amount)
- elsif denom === 8
+ when 8
btc = to_cad(amount)
- elsif denom === 9
+ when 9
btc = to_cny(amount)
- elsif denom === 10
+ when 10
btc = to_gbp(amount)
- elsif denom === 11
+ when 11
btc = to_idr(amount)
- elsif denom === 12
+ when 12
btc = to_ils(amount)
- elsif denom === 13
+ when 13
btc = to_jpy(amount)
- elsif denom === 14
+ when 14
btc = to_mxn(amount)
- elsif denom === 15
+ when 15
btc = to_nok(amount)
- elsif denom === 16
+ when 16
btc = to_nzd(amount)
- elsif denom === 17
+ when 17
btc = to_pln(amount)
- elsif denom === 18
+ when 18
btc = to_ron(amount)
- elsif denom === 19
+ when 19
btc = to_rub(amount)
- elsif denom === 20
+ when 20
btc = to_sek(amount)
- elsif denom === 21
+ when 21
btc = to_sgd(amount)
- elsif denom === 22
+ when 22
btc = to_zar(amount)
end
btc = "#{btc}" if nobr
diff --git a/app/models/project.rb b/app/models/project.rb
index 5a75e007..5547cb00 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -122,27 +122,29 @@ def tip_commits
end
def tip_for(commit)
- if next_tip_amount.positive? && !Tip.exists?(commit: commit.sha)
- return unless (user = User.find_by_commit commit)
+ return unless next_tip_amount.positive?
+ return if Tip.exists?(commit: commit.sha)
- user.update(nickname: commit.author.login) if commit.author.try(:login)
+ user = User.find_by_commit(commit)
+ return if user.nil?
- amount = if hold_tips
- nil
- else
- next_tip_amount
- end
+ user.update(nickname: commit.author.login) if commit.author.try(:login)
- # create tip
- tip = tips.create({ user: user,
- amount: amount,
- commit: commit.sha,
- commit_message: commit.commit.message })
+ amount = if hold_tips
+ nil
+ else
+ next_tip_amount
+ end
- # tip.notify_user
+ # create a tip
+ tip = tips.create(
+ user: user,
+ amount: amount,
+ commit: commit.sha,
+ commit_message: commit.commit.message
+ )
- Rails.logger.info " Tip created #{tip.inspect}"
- end
+ Rails.logger.info " Tip created #{tip.inspect}"
end
def donated
diff --git a/app/models/tip.rb b/app/models/tip.rb
index e243c244..89cdabf8 100644
--- a/app/models/tip.rb
+++ b/app/models/tip.rb
@@ -125,13 +125,14 @@ def amount_percentage=(percentage)
end
def check_amount_against_project
- if amount && amount_changed?
- available_amount = project.available_amount
- available_amount -= amount_was if amount_was
- if amount > available_amount
- raise "Not enough funds on project to save #{inspect} (available: #{available_amount}). Project #{project.inspect} available_amount: #{project.available_amount} #{project.tips.count} tips: #{project.tips.map(&:amount).join(', ')}"
- end
- end
+ return unless amount && amount_changed?
+
+ available_amount = project.available_amount
+ available_amount -= amount_was if amount_was
+
+ return if amount <= available_amount
+
+ raise "Not enough funds on project to save #{inspect} (available: #{available_amount}). Project #{project.inspect} available_amount: #{project.available_amount} #{project.tips.count} tips: #{project.tips.map(&:amount).join(', ')}"
end
def touch_decided_at_if_decided
From 0c912186d0844816c44a8beb92f965628a55f471 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 29 Nov 2020 16:25:49 +0100
Subject: [PATCH 079/159] refactored project loading
---
.rubocop_todo.yml | 14 +++++------
app/controllers/application_controller.rb | 30 ++++-------------------
app/controllers/deposits_controller.rb | 17 ++++++++++++-
app/controllers/projects_controller.rb | 8 +++++-
app/controllers/tips_controller.rb | 17 ++++++++++++-
app/models/project.rb | 4 +++
6 files changed, 55 insertions(+), 35 deletions(-)
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index fc4d08eb..bbfdad60 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
-# on 2020-11-28 07:55:00 UTC using RuboCop version 1.3.1.
+# on 2020-11-29 15:24:20 UTC using RuboCop version 1.3.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
@@ -11,7 +11,7 @@ Lint/MissingSuper:
Exclude:
- 'lib/bitcoin_rpc.rb'
-# Offense count: 17
+# Offense count: 18
# Configuration parameters: IgnoredMethods.
Metrics/AbcSize:
Max: 51
@@ -25,14 +25,14 @@ Metrics/BlockLength:
# Offense count: 2
# Configuration parameters: CountComments, CountAsOne.
Metrics/ClassLength:
- Max: 184
+ Max: 187
-# Offense count: 6
+# Offense count: 5
# Configuration parameters: IgnoredMethods.
Metrics/CyclomaticComplexity:
Max: 29
-# Offense count: 21
+# Offense count: 20
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
Metrics/MethodLength:
Max: 57
@@ -42,10 +42,10 @@ Metrics/MethodLength:
Metrics/ModuleLength:
Max: 163
-# Offense count: 6
+# Offense count: 5
# Configuration parameters: IgnoredMethods.
Metrics/PerceivedComplexity:
- Max: 20
+ Max: 18
# Offense count: 1
# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros.
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 3beb1947..b9a789fd 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -31,33 +31,13 @@ def locale_from_http_accept_language
http_accept_language.compatible_language_from(::Rails.application.config.available_locales)&.to_sym
end
- def load_project(params)
- return unless (is_via_project = is_a? ProjectsController) ||
- (is_via_tips = is_a? TipsController) ||
- (is_via_deposits = is_a? DepositsController)
-
- is_standard_path = params[:id].present? && is_via_project
- is_association_path = params[:project_id].present?
- is_pretty_path = params[:service].present? && params[:repo].present?
- return unless is_standard_path || is_association_path || is_pretty_path
-
- if (is_standard_path || is_association_path) &&
- (project_id = is_via_project ? params[:id] : params[:project_id]) &&
- (@project = (Project.where id: project_id).first)
- if is_via_tips
- redirect_to project_tips_pretty_path @project.host, @project.full_name
- elsif is_via_deposits
- redirect_to project_deposits_pretty_path @project.host, @project.full_name
- end
- elsif is_pretty_path
- @project = Project.where(host: params[:service])
- .where('lower(`full_name`) = ?', params[:repo].downcase).first
- end
-
- return if @project.present?
+ def pretty_project_path?
+ params[:service].present? && params[:repo].present?
+ end
+ def project_not_found
flash[:error] = I18n.t('errors.project_not_found')
- redirect_to projects_path
+ redirect_to(projects_path)
end
def load_user(params)
diff --git a/app/controllers/deposits_controller.rb b/app/controllers/deposits_controller.rb
index a8c0db10..c692e4b4 100644
--- a/app/controllers/deposits_controller.rb
+++ b/app/controllers/deposits_controller.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
class DepositsController < ApplicationController
- before_action { load_project params }
+ before_action { load_project }
def index
@deposits = if @project.present?
@@ -17,4 +17,19 @@ def index
format.csv { render csv: @deposits, except: %i[updated_at confirmations fee_size], add_methods: %i[project_name fee confirmed?] }
end
end
+
+ private
+
+ def load_project
+ return unless pretty_project_path? || params[:project_id].present?
+
+ if pretty_project_path?
+ @project = Project.first_by_service_and_repo(params[:service], params[:repo])
+ elsif params[:project_id].present?
+ @project = Project.where(id: params[:project_id]).first
+ redirect_to project_deposits_pretty_path(@project.host, @project.full_name) if @project
+ end
+
+ project_not_found unless @project
+ end
end
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index f18bc9f3..e7030607 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -72,7 +72,13 @@ def decide_tip_amounts
private
def load_project
- super params
+ @project = if pretty_project_path?
+ Project.first_by_service_and_repo(params[:service], params[:repo])
+ else
+ Project.where(id: params[:id]).first
+ end
+
+ project_not_found unless @project
end
def project_params
diff --git a/app/controllers/tips_controller.rb b/app/controllers/tips_controller.rb
index 27698d40..e50cacf4 100644
--- a/app/controllers/tips_controller.rb
+++ b/app/controllers/tips_controller.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
class TipsController < ApplicationController
- before_action { load_project params }
+ before_action { load_project }
before_action { load_user params }
def index
@@ -25,4 +25,19 @@ def index
format.csv { render csv: @tips, except: %i[updated_at commit commit_message refunded_at decided_at], add_methods: %i[user_name project_name decided? claimed? paid? refunded? txid] }
end
end
+
+ private
+
+ def load_project
+ return unless pretty_project_path? || params[:project_id].present?
+
+ if pretty_project_path?
+ @project = Project.first_by_service_and_repo(params[:service], params[:repo])
+ elsif params[:project_id].present?
+ @project = Project.where(id: params[:project_id]).first
+ redirect_to project_tips_pretty_path(@project.host, @project.full_name) if @project
+ end
+
+ project_not_found unless @project
+ end
end
diff --git a/app/models/project.rb b/app/models/project.rb
index 5547cb00..10df1669 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -238,5 +238,9 @@ class << self
def export_labels
Hash[pluck(:bitcoin_address, :full_name)].to_json
end
+
+ def first_by_service_and_repo(service, repo)
+ where(host: service).where('lower(`full_name`) = ?', repo.downcase).first
+ end
end
end
From 05a7c85213f4209a6691749d738e579c6213d43b Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Fri, 4 Dec 2020 12:37:42 +0100
Subject: [PATCH 080/159] reduced perceived complexity
---
.rubocop_todo.yml | 10 ++---
app/controllers/application_controller.rb | 22 +---------
app/controllers/tips_controller.rb | 15 ++++++-
app/controllers/users_controller.rb | 5 ++-
app/models/user.rb | 49 +++++++++++++----------
5 files changed, 52 insertions(+), 49 deletions(-)
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index bbfdad60..dc1014ad 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
-# on 2020-11-29 15:24:20 UTC using RuboCop version 1.3.1.
+# on 2020-12-04 11:36:42 UTC using RuboCop version 1.3.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
@@ -27,12 +27,12 @@ Metrics/BlockLength:
Metrics/ClassLength:
Max: 187
-# Offense count: 5
+# Offense count: 4
# Configuration parameters: IgnoredMethods.
Metrics/CyclomaticComplexity:
Max: 29
-# Offense count: 20
+# Offense count: 19
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
Metrics/MethodLength:
Max: 57
@@ -42,10 +42,10 @@ Metrics/MethodLength:
Metrics/ModuleLength:
Max: 163
-# Offense count: 5
+# Offense count: 4
# Configuration parameters: IgnoredMethods.
Metrics/PerceivedComplexity:
- Max: 18
+ Max: 13
# Offense count: 1
# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros.
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index b9a789fd..66e514ca 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -40,26 +40,8 @@ def project_not_found
redirect_to(projects_path)
end
- def load_user(params)
- return unless (is_via_user = is_a? UsersController) ||
- (is_via_tips = is_a? TipsController)
-
- return unless (is_standard_path = params[:id].present? && is_via_user) ||
- (is_association_path = params[:user_id].present?) ||
- (is_pretty_path = params[:nickname].present?)
-
- if (is_standard_path || is_association_path) &&
- (user_id = (is_via_user && params[:id]) ||
- (is_via_tips && params[:user_id])) &&
- (@user = User.where(id: user_id).first)
- redirect_to user_tips_pretty_path @user.nickname if is_via_tips
- elsif is_pretty_path
- @user = User.where('lower(`nickname`) = ?', params[:nickname].downcase).first
- end
-
- return if @user.present?
-
+ def user_not_found
flash[:error] = I18n.t('errors.user_not_found')
- redirect_to users_path
+ redirect_to(users_path)
end
end
diff --git a/app/controllers/tips_controller.rb b/app/controllers/tips_controller.rb
index e50cacf4..dad3b6fd 100644
--- a/app/controllers/tips_controller.rb
+++ b/app/controllers/tips_controller.rb
@@ -2,7 +2,7 @@
class TipsController < ApplicationController
before_action { load_project }
- before_action { load_user params }
+ before_action { load_user }
def index
if @project.present?
@@ -40,4 +40,17 @@ def load_project
project_not_found unless @project
end
+
+ def load_user
+ return unless params[:user_id].present? || params[:nickname].present?
+
+ if params[:nickname].present?
+ @user = User.first_by_nickname(params[:nickname])
+ elsif params[:user_id].present?
+ @user = User.where(id: params[:user_id]).first
+ redirect_to user_tips_pretty_path(@user.nickname) if @user
+ end
+
+ user_not_found unless @user
+ end
end
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 386b627f..60fca9b2 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -53,7 +53,10 @@ def users_params
end
def load_user
- super params
+ @user = User.where(id: params[:id]).first if params[:id].present?
+ @user ||= User.first_by_nickname(params[:nickname]) if params[:nickname].present?
+
+ user_not_found unless @user
end
def valid_user!
diff --git a/app/models/user.rb b/app/models/user.rb
index 04953db2..bf06cfe3 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -50,34 +50,39 @@ def subscribed?
!unsubscribed?
end
- # Class Methods
- def self.update_cache
- includes(:tips).find_each do |user|
- user.update commits_count: user.tips.count
- user.update withdrawn_amount: user.tips.paid.sum(:amount)
- end
+ def ready_for_withdrawal?
+ bitcoin_address.present? && balance >= CONFIG['min_payout']
end
- def self.create_with_omniauth!(auth_info)
- generated_password = Devise.friendly_token.first(Devise.password_length.min)
- create do |user|
- user.email = auth_info.email
- user.password = generated_password
- user.nickname = auth_info.nickname
- user.display_name = auth_info.name
- user.skip_confirmation!
+ class << self
+ def update_cache
+ includes(:tips).find_each do |user|
+ user.update commits_count: user.tips.count
+ user.update withdrawn_amount: user.tips.paid.sum(:amount)
+ end
end
- end
- def self.find_by_commit(commit)
- email = commit.commit.author.email
- nickname = commit.author.try(:login)
+ def create_with_omniauth!(auth_info)
+ generated_password = Devise.friendly_token.first(Devise.password_length.min)
+ create do |user|
+ user.email = auth_info.email
+ user.password = generated_password
+ user.nickname = auth_info.nickname
+ user.display_name = auth_info.name
+ user.skip_confirmation!
+ end
+ end
- find_by(email: email) || (nickname.blank? ? nil : find_by(nickname: nickname))
- end
+ def find_by_commit(commit)
+ email = commit.commit.author.email
+ nickname = commit.author.try(:login)
- def ready_for_withdrawal?
- bitcoin_address.present? && balance >= CONFIG['min_payout']
+ find_by(email: email) || (nickname.blank? ? nil : find_by(nickname: nickname))
+ end
+
+ def first_by_nickname(nickname)
+ where('lower(`nickname`) = ?', nickname.downcase).first
+ end
end
private
From a48ca3a05be95fc0de3bfc2bd6fe574239b6df4f Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Fri, 4 Dec 2020 14:26:24 +0100
Subject: [PATCH 081/159] upgraded ruby to 2.6.6
---
.rubocop.yml | 2 +-
.travis.yml | 2 +-
Gemfile | 2 +-
Gemfile.lock | 2 +-
config/deploy.rb | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/.rubocop.yml b/.rubocop.yml
index 0229b48a..94569d64 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -2,7 +2,7 @@
inherit_from: .rubocop_todo.yml
AllCops:
- TargetRubyVersion: 2.5
+ TargetRubyVersion: 2.6
NewCops: enable
Exclude:
- 'db/schema.rb'
diff --git a/.travis.yml b/.travis.yml
index 7529506b..8e4b01eb 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,7 +6,7 @@ git:
depth: 10
rvm:
- - 2.5.8
+ - 2.6.6
bundler_args: --without development --jobs=9 --retry=2 --quiet
diff --git a/Gemfile b/Gemfile
index f2c465e3..a64bf791 100644
--- a/Gemfile
+++ b/Gemfile
@@ -2,7 +2,7 @@
source 'https://rubygems.org'
-ruby '2.5.8'
+ruby '2.6.6'
gem 'rails', '5.2.4.4'
diff --git a/Gemfile.lock b/Gemfile.lock
index 34ed5444..9ae8b838 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -493,7 +493,7 @@ DEPENDENCIES
webmock
RUBY VERSION
- ruby 2.5.8p224
+ ruby 2.6.6p146
BUNDLED WITH
2.1.4
diff --git a/config/deploy.rb b/config/deploy.rb
index 275e612a..73aa10e3 100644
--- a/config/deploy.rb
+++ b/config/deploy.rb
@@ -8,7 +8,7 @@
set :deploy_to, '/home/apps/t4c'
set :rvm_type, :user
-set :rvm_ruby_version, '2.5.8'
+set :rvm_ruby_version, '2.6.6'
set :rvm_custom_path, '~/.rvm'
set :format, :pretty
From 1ae05903153a66b6391793496e0d8a825677cc54 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Fri, 4 Dec 2020 16:55:54 +0100
Subject: [PATCH 082/159] updated gems
---
Gemfile.lock | 24 +++++++++++++-----------
features/step_definitions/common.rb | 2 +-
2 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/Gemfile.lock b/Gemfile.lock
index 9ae8b838..733e3dd0 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -49,7 +49,7 @@ GEM
public_suffix (>= 2.0.2, < 5.0)
airbrake (11.0.1)
airbrake-ruby (~> 5.1)
- airbrake-ruby (5.1.1)
+ airbrake-ruby (5.2.0)
rbtree3 (~> 0.5)
airbrussh (1.4.0)
sshkit (>= 1.6.1, != 1.7.0)
@@ -77,7 +77,7 @@ GEM
capistrano-rvm (0.1.2)
capistrano (~> 3.0)
sshkit (~> 1.2)
- capybara (3.33.0)
+ capybara (3.34.0)
addressable
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
@@ -155,7 +155,7 @@ GEM
gherkin (5.1.0)
globalid (0.4.2)
activesupport (>= 4.2.0)
- haml (5.2.0)
+ haml (5.2.1)
temple (>= 0.8.0)
tilt
haml-rails (2.0.1)
@@ -211,7 +211,7 @@ GEM
less (~> 2.6.0)
sprockets (>= 2)
libv8 (3.16.14.19)
- loofah (2.7.0)
+ loofah (2.8.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
@@ -262,7 +262,7 @@ GEM
actionpack (>= 4.2)
omniauth (>= 1.3.1)
orm_adapter (0.5.0)
- parallel (1.20.0)
+ parallel (1.20.1)
parser (2.7.2.0)
ast (~> 2.4.1)
public_suffix (4.0.6)
@@ -341,16 +341,16 @@ GEM
rspec-mocks (~> 3.9)
rspec-support (~> 3.9)
rspec-support (3.10.0)
- rubocop (1.3.1)
+ rubocop (1.5.2)
parallel (~> 1.10)
parser (>= 2.7.1.5)
rainbow (>= 2.2.2, < 4.0)
- regexp_parser (>= 1.8)
+ regexp_parser (>= 1.8, < 3.0)
rexml
- rubocop-ast (>= 1.1.1)
+ rubocop-ast (>= 1.2.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 2.0)
- rubocop-ast (1.1.1)
+ rubocop-ast (1.3.0)
parser (>= 2.7.1.5)
ruby-progressbar (1.10.1)
ruby2_keywords (0.0.2)
@@ -378,10 +378,12 @@ GEM
connection_pool (>= 2.2.2)
rack (~> 2.0)
redis (>= 4.2.0)
- simplecov (0.19.1)
+ simplecov (0.20.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
+ simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
+ simplecov_json_formatter (0.1.2)
sprockets (4.0.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
@@ -390,7 +392,7 @@ GEM
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sqlite3 (1.4.2)
- sshkit (1.21.0)
+ sshkit (1.21.1)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
temple (0.8.2)
diff --git a/features/step_definitions/common.rb b/features/step_definitions/common.rb
index 03a29c01..2a7f96a3 100644
--- a/features/step_definitions/common.rb
+++ b/features/step_definitions/common.rb
@@ -72,7 +72,7 @@ def parse_path_from_page_string(page_string)
# explicit cases
# e.g. "a-user/a-project github-project edit"
# e.g. "a-user user edit"
- tokens = page_string.split ' '
+ tokens = page_string.split
name = tokens[0]
model = tokens[1]
action = tokens[2] || '' # '' => 'show'
From f0f3b9d373f98dc2aea3844239cd8bab45065d7d Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Fri, 4 Dec 2020 17:03:14 +0100
Subject: [PATCH 083/159] fixed turbolinks page loading
---
app/assets/javascripts/application.js.coffee | 4 ++--
app/assets/javascripts/projects.js.coffee | 2 +-
app/assets/javascripts/users.js.coffee | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee
index 1f23d93f..73027893 100644
--- a/app/assets/javascripts/application.js.coffee
+++ b/app/assets/javascripts/application.js.coffee
@@ -7,7 +7,7 @@
#= require i18n/translations
#= require_tree .
-$(document).on "ready page:change", ->
+$(document).on "ready turbolinks:load", ->
# Remove all global properties set by addthis, otherwise it won't reinitialize
for i of window
@@ -18,4 +18,4 @@ $(document).on "ready page:change", ->
$.getScript "//s7.addthis.com/js/250/addthis_widget.js#pubid=ra-526425ac0ea0780b"
$('.noclick').click () ->
- return false
\ No newline at end of file
+ return false
diff --git a/app/assets/javascripts/projects.js.coffee b/app/assets/javascripts/projects.js.coffee
index 86bd3f15..4cb54f5c 100644
--- a/app/assets/javascripts/projects.js.coffee
+++ b/app/assets/javascripts/projects.js.coffee
@@ -6,4 +6,4 @@ init = () ->
$('.qrcode').each () ->
$(this).qrcode($(this).attr('data-qrcode'));
-$(document).on 'ready page:load', init
\ No newline at end of file
+$(document).on 'ready turbolinks:load', init
diff --git a/app/assets/javascripts/users.js.coffee b/app/assets/javascripts/users.js.coffee
index 056e5d7a..77d18a71 100644
--- a/app/assets/javascripts/users.js.coffee
+++ b/app/assets/javascripts/users.js.coffee
@@ -39,7 +39,7 @@ load_bootstrap_validator = ->
notEmpty:
message: I18n.t('js.errors.password_confirmation.blank')
-$(document).on "ready page:load", load_bootstrap_validator
+$(document).on "ready turbolinks:load", load_bootstrap_validator
$ ->
$('.from-gravatar').click (e) ->
From 97f5ff831c006947ad7030156beff9c37fc16b04 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sat, 5 Dec 2020 10:39:07 +0100
Subject: [PATCH 084/159] rubocop rspec and rails + fixes
---
.rubocop.yml | 9 +
.rubocop_todo.yml | 167 ++++++++++++++++--
Gemfile | 2 +
Gemfile.lock | 9 +
app/controllers/users_controller.rb | 2 +-
app/helpers/application_helper.rb | 6 +-
app/helpers/projects_helper.rb | 6 +-
app/models/tip.rb | 2 +-
db/migrate/20140223061035_add_project_host.rb | 2 +-
...20140402082149_add_fee_size_to_deposits.rb | 2 +-
lib/tasks/cucumber.rake | 6 +-
spec/controllers/projects_controller_spec.rb | 1 +
spec/controllers/users_controller_spec.rb | 1 +
spec/lib/blacklist_spec.rb | 2 +-
spec/models/collaborator_spec.rb | 2 +-
spec/models/deposit_spec.rb | 2 +-
spec/models/project_spec.rb | 24 +--
spec/models/send_many_spec.rb | 2 +-
spec/models/sendmany_spec.rb | 2 +-
spec/models/tip_spec.rb | 6 +-
spec/models/tipping_policies_text_spec.rb | 4 +-
spec/models/user_spec.rb | 18 +-
spec/models/wallet_spec.rb | 8 +-
.../requests/cve_2005_9284_regression_spec.rb | 8 +-
24 files changed, 230 insertions(+), 63 deletions(-)
diff --git a/.rubocop.yml b/.rubocop.yml
index 94569d64..8d1b38d9 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -1,6 +1,10 @@
inherit_from: .rubocop_todo.yml
+require:
+ - rubocop-rails
+ - rubocop-rspec
+
AllCops:
TargetRubyVersion: 2.6
NewCops: enable
@@ -10,3 +14,8 @@ AllCops:
Style/Documentation:
Enabled: false
+
+Rails/DynamicFindBy:
+ Whitelist:
+ - find_by_url
+ - find_by_commit
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index dc1014ad..593fc296 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -1,24 +1,19 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
-# on 2020-12-04 11:36:42 UTC using RuboCop version 1.3.1.
+# on 2020-12-05 09:33:58 UTC using RuboCop version 1.5.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
-# Offense count: 1
-Lint/MissingSuper:
- Exclude:
- - 'lib/bitcoin_rpc.rb'
-
# Offense count: 18
-# Configuration parameters: IgnoredMethods.
+# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 51
# Offense count: 17
-# Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
-# ExcludedMethods: refine
+# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
+# IgnoredMethods: refine
Metrics/BlockLength:
Max: 224
@@ -33,7 +28,7 @@ Metrics/CyclomaticComplexity:
Max: 29
# Offense count: 19
-# Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
+# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
Metrics/MethodLength:
Max: 57
@@ -55,9 +50,159 @@ Metrics/PerceivedComplexity:
# MethodDefinitionMacros: define_method, define_singleton_method
Naming/PredicateName:
Exclude:
- - 'spec/**/*'
- 'app/models/project.rb'
+# Offense count: 3
+# Configuration parameters: Prefixes.
+# Prefixes: when, with, without
+RSpec/ContextWording:
+ Exclude:
+ - 'spec/controllers/projects_controller_spec.rb'
+
+# Offense count: 1
+# Configuration parameters: IgnoredMetadata.
+RSpec/DescribeClass:
+ Exclude:
+ - 'spec/misc_spec.rb'
+
+# Offense count: 13
+# Configuration parameters: Max.
+RSpec/ExampleLength:
+ Exclude:
+ - 'spec/controllers/projects_controller_spec.rb'
+ - 'spec/controllers/users_controller_spec.rb'
+ - 'spec/lib/blacklist_spec.rb'
+ - 'spec/models/deposit_spec.rb'
+
+# Offense count: 25
+# Cop supports --auto-correct.
+RSpec/ExpectActual:
+ Exclude:
+ - 'spec/controllers/deposits_controller_spec.rb'
+ - 'spec/controllers/home_controller_spec.rb'
+ - 'spec/controllers/projects_controller_spec.rb'
+ - 'spec/controllers/tips_controller_spec.rb'
+ - 'spec/controllers/users_controller_spec.rb'
+ - 'spec/controllers/withdrawals_controller_spec.rb'
+
+# Offense count: 1
+# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
+# Include: **/*_spec*rb*, **/spec/**/*
+RSpec/FilePath:
+ Exclude:
+ - 'spec/models/send_many_spec.rb'
+
+# Offense count: 2
+# Configuration parameters: AssignmentOnly.
+RSpec/InstanceVariable:
+ Exclude:
+ - 'spec/controllers/users_controller_spec.rb'
+ - 'spec/requests/cve_2005_9284_regression_spec.rb'
+
+# Offense count: 3
+# Configuration parameters: .
+# SupportedStyles: have_received, receive
+RSpec/MessageSpies:
+ EnforcedStyle: receive
+
+# Offense count: 3
+RSpec/MultipleExpectations:
+ Max: 9
+
+# Offense count: 26
+# Configuration parameters: IgnoreSharedExamples.
+RSpec/NamedSubject:
+ Exclude:
+ - 'spec/controllers/home_controller_spec.rb'
+ - 'spec/controllers/projects_controller_spec.rb'
+ - 'spec/controllers/users_controller_spec.rb'
+ - 'spec/models/wallet_spec.rb'
+
+# Offense count: 4
+RSpec/NestedGroups:
+ Max: 5
+
+# Offense count: 2
+RSpec/RepeatedExample:
+ Exclude:
+ - 'spec/controllers/home_controller_spec.rb'
+
+# Offense count: 2
+RSpec/RepeatedExampleGroupBody:
+ Exclude:
+ - 'spec/models/user_spec.rb'
+
+# Offense count: 3
+RSpec/StubbedMock:
+ Exclude:
+ - 'spec/controllers/projects_controller_spec.rb'
+
+# Offense count: 9
+# Configuration parameters: Database, Include.
+# SupportedDatabases: mysql, postgresql
+# Include: db/migrate/*.rb
+Rails/BulkChangeTable:
+ Exclude:
+ - 'db/migrate/20131019133109_devise_create_users.rb'
+ - 'db/migrate/20131019133235_add_columns_to_users.rb'
+ - 'db/migrate/20131019175751_add_some_fields_to_projects.rb'
+ - 'db/migrate/20131212190037_add_cache_to_users.rb'
+ - 'db/migrate/20140102095035_add_refunded_at_to_tips.rb'
+ - 'db/migrate/20140209041123_create_indexes_for_projects.rb'
+ - 'db/migrate/20140402082149_add_fee_size_to_deposits.rb'
+ - 'db/migrate/20140722092532_add_confirmation_fields_to_users.rb'
+ - 'db/migrate/20140816062159_remove_paid_out_from_deposits.rb'
+
+# Offense count: 2
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: slashes, arguments
+Rails/FilePath:
+ Exclude:
+ - 'lib/tasks/cucumber.rake'
+ - 'spec/misc_spec.rb'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+# Configuration parameters: Include.
+# Include: app/models/**/*.rb
+Rails/FindBy:
+ Exclude:
+ - 'app/models/project.rb'
+ - 'app/models/user.rb'
+
+# Offense count: 6
+# Configuration parameters: Include.
+# Include: app/models/**/*.rb
+Rails/HasManyOrHasOneDependent:
+ Exclude:
+ - 'app/models/project.rb'
+ - 'app/models/sendmany.rb'
+ - 'app/models/user.rb'
+
+# Offense count: 2
+Rails/OutputSafety:
+ Exclude:
+ - 'app/helpers/application_helper.rb'
+
+# Offense count: 1
+# Configuration parameters: Include.
+# Include: db/migrate/*.rb
+Rails/ReversibleMigration:
+ Exclude:
+ - 'db/migrate/20131030142749_drop_deposit_from_tip.rb'
+
+# Offense count: 11
+# Configuration parameters: ForbiddenMethods, AllowedMethods.
+# ForbiddenMethods: decrement!, decrement_counter, increment!, increment_counter, insert, insert!, insert_all, insert_all!, toggle!, touch, touch_all, update_all, update_attribute, update_column, update_columns, update_counters, upsert, upsert_all
+Rails/SkipsModelValidations:
+ Exclude:
+ - 'app/models/project.rb'
+ - 'app/models/sendmany.rb'
+ - 'app/models/tip.rb'
+ - 'db/migrate/20140223061035_add_project_host.rb'
+ - 'db/migrate/20140402082149_add_fee_size_to_deposits.rb'
+ - 'lib/bitcoin_tipper.rb'
+
# Offense count: 1
Style/MissingRespondToMissing:
Exclude:
diff --git a/Gemfile b/Gemfile
index a64bf791..b7caddd2 100644
--- a/Gemfile
+++ b/Gemfile
@@ -61,6 +61,8 @@ group :development, :test do
gem 'factory_bot_rails'
gem 'rspec-rails'
gem 'rubocop'
+ gem 'rubocop-rails'
+ gem 'rubocop-rspec'
gem 'sqlite3'
end
diff --git a/Gemfile.lock b/Gemfile.lock
index 733e3dd0..edbb4deb 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -352,6 +352,13 @@ GEM
unicode-display_width (>= 1.4.0, < 2.0)
rubocop-ast (1.3.0)
parser (>= 2.7.1.5)
+ rubocop-rails (2.8.1)
+ activesupport (>= 4.2.0)
+ rack (>= 1.1)
+ rubocop (>= 0.87.0)
+ rubocop-rspec (2.0.1)
+ rubocop (~> 1.0)
+ rubocop-ast (>= 1.1.0)
ruby-progressbar (1.10.1)
ruby2_keywords (0.0.2)
ruby_parser (3.15.0)
@@ -479,6 +486,8 @@ DEPENDENCIES
rspec-activemodel-mocks
rspec-rails
rubocop
+ rubocop-rails
+ rubocop-rspec
sass-rails
sawyer
sdoc
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 60fca9b2..e3783c81 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -14,7 +14,7 @@ def index
end
def update
- if @user.update_attributes(users_params)
+ if @user.update(users_params)
redirect_to @user, notice: I18n.t('notices.user_updated')
else
show
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 67b38124..5380ae7d 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -158,7 +158,7 @@ def rate(currency, satoshies)
end
def get_rate(currency)
- Rails.cache.fetch("####{currency}", expires_in: 1.hours) do
+ Rails.cache.fetch("####{currency}", expires_in: 1.hour) do
uri = URI("https://api.coindesk.com/v1/bpi/currentprice/#{currency}.json")
response = Net::HTTP.get_response(uri)
hash = JSON.parse(response.body)
@@ -173,13 +173,13 @@ def render_flash_messages
when 'notice' then :success
when 'alert', 'error' then :danger
end
- html << content_tag(:div, class: "alert alert-#{alert_type}") { message }
+ html << tag.div(class: "alert alert-#{alert_type}") { message }
end
html.join("\n").html_safe
end
def commit_tag(sha1)
- content_tag(:span, truncate(sha1, length: 10, omission: ''), class: 'commit-sha')
+ tag.span(truncate(sha1, length: 10, omission: ''), class: 'commit-sha')
end
def list_friendly_text(a_list, conjunction)
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index 349739be..ac49e100 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -8,11 +8,11 @@ def shield_btc_amount(amount)
def shield_color(project)
last_tip = project.tips.order(:created_at).last
- if last_tip.nil? || (Time.now - last_tip.created_at > 30.days)
+ if last_tip.nil? || (Time.zone.now - last_tip.created_at > 30.days)
'red'
- elsif Time.now - last_tip.created_at > 7.days
+ elsif Time.zone.now - last_tip.created_at > 7.days
'yellow'
- elsif Time.now - last_tip.created_at > 1.day
+ elsif Time.zone.now - last_tip.created_at > 1.day
'yellowgreen'
else
'green'
diff --git a/app/models/tip.rb b/app/models/tip.rb
index 89cdabf8..1def86ca 100644
--- a/app/models/tip.rb
+++ b/app/models/tip.rb
@@ -136,7 +136,7 @@ def check_amount_against_project
end
def touch_decided_at_if_decided
- self.decided_at = Time.now if amount_changed? && decided?
+ self.decided_at = Time.zone.now if amount_changed? && decided?
end
def project_name
diff --git a/db/migrate/20140223061035_add_project_host.rb b/db/migrate/20140223061035_add_project_host.rb
index 60fb7f07..d5e4c9d8 100644
--- a/db/migrate/20140223061035_add_project_host.rb
+++ b/db/migrate/20140223061035_add_project_host.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
class AddProjectHost < ActiveRecord::Migration[4.2]
- class Project < ActiveRecord::Base
+ class Project < ApplicationRecord
end
def change
diff --git a/db/migrate/20140402082149_add_fee_size_to_deposits.rb b/db/migrate/20140402082149_add_fee_size_to_deposits.rb
index 9a4ff742..c335fd50 100644
--- a/db/migrate/20140402082149_add_fee_size_to_deposits.rb
+++ b/db/migrate/20140402082149_add_fee_size_to_deposits.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
class AddFeeSizeToDeposits < ActiveRecord::Migration[4.2]
- class Deposit < ActiveRecord::Base
+ class Deposit < ApplicationRecord
end
def change
diff --git a/lib/tasks/cucumber.rake b/lib/tasks/cucumber.rake
index 4d81c9d1..28b9e8ad 100644
--- a/lib/tasks/cucumber.rake
+++ b/lib/tasks/cucumber.rake
@@ -36,7 +36,7 @@ unless ARGV.any? { |a| a =~ /^gems/ } # Don't load anything when running the gem
desc 'Run all features'
task all: %i[ok wip]
- task :statsetup do
+ task statsetup: :environment do
require 'rails/code_statistics'
::STATS_DIRECTORIES << %w[Cucumber\ features features] if File.exist?('features')
::CodeStatistics::TEST_TYPES << 'Cucumber features' if File.exist?('features')
@@ -51,7 +51,7 @@ unless ARGV.any? { |a| a =~ /^gems/ } # Don't load anything when running the gem
warn "*** The 'features' task is deprecated. See rake -T cucumber ***"
end
- task 'test:prepare' do
+ task 'test:prepare' => :environment do
# In case we don't have the generic Rails test:prepare hook,
# append a no-op task that we can depend upon.
end
@@ -59,7 +59,7 @@ unless ARGV.any? { |a| a =~ /^gems/ } # Don't load anything when running the gem
task stats: 'cucumber:statsetup'
rescue LoadError
desc 'cucumber rake task not available (cucumber not installed)'
- task :cucumber do
+ task cucumber: :environment do
abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
end
end
diff --git a/spec/controllers/projects_controller_spec.rb b/spec/controllers/projects_controller_spec.rb
index d7d189f3..11f8347f 100644
--- a/spec/controllers/projects_controller_spec.rb
+++ b/spec/controllers/projects_controller_spec.rb
@@ -5,6 +5,7 @@
describe ProjectsController, type: :controller do
describe 'GET #index' do
let(:subject) { get :index }
+
before do
allow(Project).to receive(:order).with(available_amount_cache: :desc, watchers_count: :desc, full_name: :asc).and_return(Project)
allow(Project).to receive(:page).with(nil).and_return(Project)
diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb
index 70b6cb2d..c9c52616 100644
--- a/spec/controllers/users_controller_spec.rb
+++ b/spec/controllers/users_controller_spec.rb
@@ -30,6 +30,7 @@
context 'when user found' do
context 'when viewing own page' do
before { allow(user).to receive(:id).and_return(@current_user.id) }
+
it 'renders show template' do
expect(subject).to render_template :show
end
diff --git a/spec/lib/blacklist_spec.rb b/spec/lib/blacklist_spec.rb
index 78c7e693..607499f0 100644
--- a/spec/lib/blacklist_spec.rb
+++ b/spec/lib/blacklist_spec.rb
@@ -11,7 +11,7 @@
'https://bitbucket.org/notips/*'
]
- list = Blacklist.new(urls)
+ list = described_class.new(urls)
# Blacklisted projects.
expect(list.include?('https://github.com/author/notips')).to eq(true)
diff --git a/spec/models/collaborator_spec.rb b/spec/models/collaborator_spec.rb
index 2fe276c8..994d31e9 100644
--- a/spec/models/collaborator_spec.rb
+++ b/spec/models/collaborator_spec.rb
@@ -4,6 +4,6 @@
describe Collaborator, type: :model do
describe 'Associations' do
- it { should belong_to :project }
+ it { is_expected.to belong_to :project }
end
end
diff --git a/spec/models/deposit_spec.rb b/spec/models/deposit_spec.rb
index 6456520e..1f50fc5f 100644
--- a/spec/models/deposit_spec.rb
+++ b/spec/models/deposit_spec.rb
@@ -6,7 +6,7 @@
let(:deposit) { create(:deposit) }
describe 'Associations' do
- it { should belong_to :project }
+ it { is_expected.to belong_to :project }
end
describe '#fee' do
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index d72bcd79..535acec6 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -7,18 +7,18 @@
let(:project_of_bitbucket) { create(:project, :bitbucket) }
describe 'Associations' do
- it { should have_many(:deposits) }
- it { should have_many(:tips) }
- it { should belong_to(:wallet) }
+ it { is_expected.to have_many(:deposits) }
+ it { is_expected.to have_many(:tips) }
+ it { is_expected.to belong_to(:wallet) }
end
describe 'Validations' do
- it { should validate_presence_of(:full_name) }
- it { should validate_presence_of(:github_id) }
- it { should validate_presence_of(:host) }
- it { should validate_uniqueness_of(:full_name) }
- it { should validate_uniqueness_of(:github_id) }
- it { should validate_inclusion_of(:host).in_array %w[github bitbucket] }
+ it { is_expected.to validate_presence_of(:full_name) }
+ it { is_expected.to validate_presence_of(:github_id) }
+ it { is_expected.to validate_presence_of(:host) }
+ it { is_expected.to validate_uniqueness_of(:full_name) }
+ it { is_expected.to validate_uniqueness_of(:github_id) }
+ it { is_expected.to validate_inclusion_of(:host).in_array %w[github bitbucket] }
end
describe 'bitcoin_address' do
@@ -29,15 +29,15 @@
wallet
end
- it 'should generate a bitcoin address' do
+ it 'generates a bitcoin address' do
expect(project.bitcoin_address).not_to be_blank
end
- it 'should connect project to the last wallet' do
+ it 'connects project to the last wallet' do
expect(project.wallet).to eq wallet
end
- it 'should increment wallet\'s last_address_index' do
+ it "increments wallet's last_address_index" do
expect { project }.to change { wallet.reload.last_address_index }.by 1
end
end
diff --git a/spec/models/send_many_spec.rb b/spec/models/send_many_spec.rb
index 4f1c3435..428efb30 100644
--- a/spec/models/send_many_spec.rb
+++ b/spec/models/send_many_spec.rb
@@ -4,6 +4,6 @@
describe Sendmany, type: :model do
describe 'Associations' do
- it { should have_many :tips }
+ it { is_expected.to have_many :tips }
end
end
diff --git a/spec/models/sendmany_spec.rb b/spec/models/sendmany_spec.rb
index 4f1c3435..428efb30 100644
--- a/spec/models/sendmany_spec.rb
+++ b/spec/models/sendmany_spec.rb
@@ -4,6 +4,6 @@
describe Sendmany, type: :model do
describe 'Associations' do
- it { should have_many :tips }
+ it { is_expected.to have_many :tips }
end
end
diff --git a/spec/models/tip_spec.rb b/spec/models/tip_spec.rb
index 3bd46d4c..2aa1fd80 100644
--- a/spec/models/tip_spec.rb
+++ b/spec/models/tip_spec.rb
@@ -4,8 +4,8 @@
describe Tip, type: :model do
describe 'Associations' do
- it { should belong_to :user }
- it { should belong_to :sendmany }
- it { should belong_to :project }
+ it { is_expected.to belong_to :user }
+ it { is_expected.to belong_to :sendmany }
+ it { is_expected.to belong_to :project }
end
end
diff --git a/spec/models/tipping_policies_text_spec.rb b/spec/models/tipping_policies_text_spec.rb
index 869a51c2..86376f5f 100644
--- a/spec/models/tipping_policies_text_spec.rb
+++ b/spec/models/tipping_policies_text_spec.rb
@@ -4,7 +4,7 @@
describe TippingPoliciesText, type: :model do
describe 'Associations' do
- it { should belong_to :project }
- it { should belong_to :user }
+ it { is_expected.to belong_to :project }
+ it { is_expected.to belong_to :user }
end
end
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index 677edf84..aac6997b 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -6,7 +6,7 @@
let(:user) { create(:user) }
describe 'Associations' do
- it { should have_many :tips }
+ it { is_expected.to have_many :tips }
end
describe 'full_name' do
@@ -33,56 +33,56 @@
describe 'bitcoin_address' do
context 'when address is blank' do
- it 'should be valid' do
+ it 'is valid' do
user.bitcoin_address = ''
expect(user).to be_valid
end
end
context 'when address is valid p2pkh address' do
- it 'should be valid' do
+ it 'is valid' do
user.bitcoin_address = '1M4bS4gPyA6Kb8w7aXsgth9oUZWcRk73tQ'
expect(user).to be_valid
end
end
context 'when address is valid p2sh address' do
- it 'should be valid' do
+ it 'is valid' do
user.bitcoin_address = '3EktnHQD7RiAE6uzMj2ZifT9YgRrkSgzQX'
expect(user).to be_valid
end
end
context 'when address is valid bech32 P2WPKH address' do
- it 'should be valid' do
+ it 'is valid' do
user.bitcoin_address = 'BC1QW508D6QEJXTDG4Y5R3ZARVARY0C5XW7KV8F3T4'
expect(user).to be_valid
end
end
context 'when address is valid bech32 P2WSH address' do
- it 'should be valid' do
+ it 'is valid' do
user.bitcoin_address = 'bc1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qccfmv3'
expect(user).to be_valid
end
end
context 'when address is not valid p2pkh' do
- it 'should not be valid' do
+ it 'is not valid' do
user.bitcoin_address = '1M4bS4gPyA6Kb8w7aXsgth9oUZXXXXXXXX'
expect(user).not_to be_valid
end
end
context 'when address is testnet bech32' do
- it 'should not be valid' do
+ it 'is not valid' do
user.bitcoin_address = 'tb1qw508d6qejxtdg4y5r3zarvary0c5xw7kxpjzsx'
expect(user).not_to be_valid
end
end
context 'when address is not valid bech32' do
- it 'should not be valid' do
+ it 'is not valid' do
user.bitcoin_address = 'tb1qw508d6qejxtdg4y5r3zarvary0c5xw7kxpjzsx'
expect(user).not_to be_valid
end
diff --git a/spec/models/wallet_spec.rb b/spec/models/wallet_spec.rb
index c7ebeab9..78fd10c9 100644
--- a/spec/models/wallet_spec.rb
+++ b/spec/models/wallet_spec.rb
@@ -6,18 +6,18 @@
let(:wallet) { create(:wallet) }
describe 'Validations' do
- it { should validate_presence_of(:name) }
- it { should validate_presence_of(:xpub) }
+ it { is_expected.to validate_presence_of(:name) }
+ it { is_expected.to validate_presence_of(:xpub) }
end
describe '#generate_address' do
subject { wallet.generate_address }
- it 'should return a new address' do
+ it 'returns a new address' do
expect(subject).to eq '125q4q36PT2gGoeNWXm34RepMcgghLghiZ'
end
- it 'should increment last_address_index' do
+ it 'increments last_address_index' do
expect { subject }.to change { wallet.reload.last_address_index }.by 1
end
end
diff --git a/spec/requests/cve_2005_9284_regression_spec.rb b/spec/requests/cve_2005_9284_regression_spec.rb
index 6d6b82ea..b311506a 100644
--- a/spec/requests/cve_2005_9284_regression_spec.rb
+++ b/spec/requests/cve_2005_9284_regression_spec.rb
@@ -17,14 +17,14 @@
ActionController::Base.allow_forgery_protection = true
end
+ after do
+ ActionController::Base.allow_forgery_protection = @allow_forgery_protection
+ end
+
it do
expect do
post '/users/auth/github'
end.to raise_error(ActionController::InvalidAuthenticityToken)
end
-
- after do
- ActionController::Base.allow_forgery_protection = @allow_forgery_protection
- end
end
end
From 4bee31037c5c2a8b7a967946c8a545033403eb37 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sat, 5 Dec 2020 10:43:29 +0100
Subject: [PATCH 085/159] do not load script twice
---
app/assets/javascripts/application.js.coffee | 2 +-
app/assets/javascripts/projects.js.coffee | 2 +-
app/assets/javascripts/users.js.coffee | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee
index 73027893..6901e003 100644
--- a/app/assets/javascripts/application.js.coffee
+++ b/app/assets/javascripts/application.js.coffee
@@ -7,7 +7,7 @@
#= require i18n/translations
#= require_tree .
-$(document).on "ready turbolinks:load", ->
+$(document).on "turbolinks:load", ->
# Remove all global properties set by addthis, otherwise it won't reinitialize
for i of window
diff --git a/app/assets/javascripts/projects.js.coffee b/app/assets/javascripts/projects.js.coffee
index 4cb54f5c..c34a24f2 100644
--- a/app/assets/javascripts/projects.js.coffee
+++ b/app/assets/javascripts/projects.js.coffee
@@ -6,4 +6,4 @@ init = () ->
$('.qrcode').each () ->
$(this).qrcode($(this).attr('data-qrcode'));
-$(document).on 'ready turbolinks:load', init
+$(document).on 'turbolinks:load', init
diff --git a/app/assets/javascripts/users.js.coffee b/app/assets/javascripts/users.js.coffee
index 77d18a71..a52f5b93 100644
--- a/app/assets/javascripts/users.js.coffee
+++ b/app/assets/javascripts/users.js.coffee
@@ -39,7 +39,7 @@ load_bootstrap_validator = ->
notEmpty:
message: I18n.t('js.errors.password_confirmation.blank')
-$(document).on "ready turbolinks:load", load_bootstrap_validator
+$(document).on "turbolinks:load", load_bootstrap_validator
$ ->
$('.from-gravatar').click (e) ->
From 8414c2e612aea968ae35878e3836716dc14a7ce5 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sat, 5 Dec 2020 10:51:08 +0100
Subject: [PATCH 086/159] fixed badges
---
app/controllers/projects_controller.rb | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index e7030607..e5d81e91 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -107,6 +107,7 @@ def redirect_to_pretty_url
path = pretty_project_decide_tip_amounts_path(@project)
end
format.html { redirect_to path }
+ format.svg
end
end
end
From 176706fe1f02a8672b3fdfc3991dc6a947add3e7 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 6 Dec 2020 11:58:34 +0100
Subject: [PATCH 087/159] rubocop fixes
---
.rubocop.yml | 2 +
.rubocop_todo.yml | 42 +------------------
app/controllers/deposits_controller.rb | 2 +-
app/controllers/projects_controller.rb | 2 +-
app/controllers/tips_controller.rb | 4 +-
app/controllers/users_controller.rb | 2 +-
app/models/project.rb | 4 +-
app/models/user.rb | 4 +-
.../20131019133109_devise_create_users.rb | 10 ++---
.../20131019133235_add_columns_to_users.rb | 8 ++--
...31019175751_add_some_fields_to_projects.rb | 14 ++++---
.../20131030142749_drop_deposit_from_tip.rb | 6 ++-
.../20131212190037_add_cache_to_users.rb | 6 ++-
.../20140102095035_add_refunded_at_to_tips.rb | 15 +++++--
...40209041123_create_indexes_for_projects.rb | 6 ++-
...20140402082149_add_fee_size_to_deposits.rb | 8 +++-
...092532_add_confirmation_fields_to_users.rb | 10 +++--
...816062159_remove_paid_out_from_deposits.rb | 15 +++++--
lib/tasks/cucumber.rake | 2 +-
spec/misc_spec.rb | 2 +-
20 files changed, 81 insertions(+), 83 deletions(-)
diff --git a/.rubocop.yml b/.rubocop.yml
index 8d1b38d9..994cd4c0 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -19,3 +19,5 @@ Rails/DynamicFindBy:
Whitelist:
- find_by_url
- find_by_commit
+ - find_by_service_and_repo
+ - find_by_nickname
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 593fc296..2975e513 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
-# on 2020-12-05 09:33:58 UTC using RuboCop version 1.5.2.
+# on 2020-12-06 10:56:23 UTC using RuboCop version 1.5.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
@@ -137,39 +137,6 @@ RSpec/StubbedMock:
Exclude:
- 'spec/controllers/projects_controller_spec.rb'
-# Offense count: 9
-# Configuration parameters: Database, Include.
-# SupportedDatabases: mysql, postgresql
-# Include: db/migrate/*.rb
-Rails/BulkChangeTable:
- Exclude:
- - 'db/migrate/20131019133109_devise_create_users.rb'
- - 'db/migrate/20131019133235_add_columns_to_users.rb'
- - 'db/migrate/20131019175751_add_some_fields_to_projects.rb'
- - 'db/migrate/20131212190037_add_cache_to_users.rb'
- - 'db/migrate/20140102095035_add_refunded_at_to_tips.rb'
- - 'db/migrate/20140209041123_create_indexes_for_projects.rb'
- - 'db/migrate/20140402082149_add_fee_size_to_deposits.rb'
- - 'db/migrate/20140722092532_add_confirmation_fields_to_users.rb'
- - 'db/migrate/20140816062159_remove_paid_out_from_deposits.rb'
-
-# Offense count: 2
-# Configuration parameters: EnforcedStyle.
-# SupportedStyles: slashes, arguments
-Rails/FilePath:
- Exclude:
- - 'lib/tasks/cucumber.rake'
- - 'spec/misc_spec.rb'
-
-# Offense count: 2
-# Cop supports --auto-correct.
-# Configuration parameters: Include.
-# Include: app/models/**/*.rb
-Rails/FindBy:
- Exclude:
- - 'app/models/project.rb'
- - 'app/models/user.rb'
-
# Offense count: 6
# Configuration parameters: Include.
# Include: app/models/**/*.rb
@@ -184,13 +151,6 @@ Rails/OutputSafety:
Exclude:
- 'app/helpers/application_helper.rb'
-# Offense count: 1
-# Configuration parameters: Include.
-# Include: db/migrate/*.rb
-Rails/ReversibleMigration:
- Exclude:
- - 'db/migrate/20131030142749_drop_deposit_from_tip.rb'
-
# Offense count: 11
# Configuration parameters: ForbiddenMethods, AllowedMethods.
# ForbiddenMethods: decrement!, decrement_counter, increment!, increment_counter, insert, insert!, insert_all, insert_all!, toggle!, touch, touch_all, update_all, update_attribute, update_column, update_columns, update_counters, upsert, upsert_all
diff --git a/app/controllers/deposits_controller.rb b/app/controllers/deposits_controller.rb
index c692e4b4..c4981233 100644
--- a/app/controllers/deposits_controller.rb
+++ b/app/controllers/deposits_controller.rb
@@ -24,7 +24,7 @@ def load_project
return unless pretty_project_path? || params[:project_id].present?
if pretty_project_path?
- @project = Project.first_by_service_and_repo(params[:service], params[:repo])
+ @project = Project.find_by_service_and_repo(params[:service], params[:repo])
elsif params[:project_id].present?
@project = Project.where(id: params[:project_id]).first
redirect_to project_deposits_pretty_path(@project.host, @project.full_name) if @project
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index e5d81e91..d6a6bde0 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -73,7 +73,7 @@ def decide_tip_amounts
def load_project
@project = if pretty_project_path?
- Project.first_by_service_and_repo(params[:service], params[:repo])
+ Project.find_by_service_and_repo(params[:service], params[:repo])
else
Project.where(id: params[:id]).first
end
diff --git a/app/controllers/tips_controller.rb b/app/controllers/tips_controller.rb
index dad3b6fd..140b7161 100644
--- a/app/controllers/tips_controller.rb
+++ b/app/controllers/tips_controller.rb
@@ -32,7 +32,7 @@ def load_project
return unless pretty_project_path? || params[:project_id].present?
if pretty_project_path?
- @project = Project.first_by_service_and_repo(params[:service], params[:repo])
+ @project = Project.find_by_service_and_repo(params[:service], params[:repo])
elsif params[:project_id].present?
@project = Project.where(id: params[:project_id]).first
redirect_to project_tips_pretty_path(@project.host, @project.full_name) if @project
@@ -45,7 +45,7 @@ def load_user
return unless params[:user_id].present? || params[:nickname].present?
if params[:nickname].present?
- @user = User.first_by_nickname(params[:nickname])
+ @user = User.find_by_nickname(params[:nickname])
elsif params[:user_id].present?
@user = User.where(id: params[:user_id]).first
redirect_to user_tips_pretty_path(@user.nickname) if @user
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index e3783c81..df127c1d 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -54,7 +54,7 @@ def users_params
def load_user
@user = User.where(id: params[:id]).first if params[:id].present?
- @user ||= User.first_by_nickname(params[:nickname]) if params[:nickname].present?
+ @user ||= User.find_by_nickname(params[:nickname]) if params[:nickname].present?
user_not_found unless @user
end
diff --git a/app/models/project.rb b/app/models/project.rb
index 10df1669..a9b7fdcb 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -239,8 +239,8 @@ def export_labels
Hash[pluck(:bitcoin_address, :full_name)].to_json
end
- def first_by_service_and_repo(service, repo)
- where(host: service).where('lower(`full_name`) = ?', repo.downcase).first
+ def find_by_service_and_repo(service, repo)
+ where(host: service).find_by('lower(`full_name`) = ?', repo.downcase)
end
end
end
diff --git a/app/models/user.rb b/app/models/user.rb
index bf06cfe3..f4ed033c 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -80,8 +80,8 @@ def find_by_commit(commit)
find_by(email: email) || (nickname.blank? ? nil : find_by(nickname: nickname))
end
- def first_by_nickname(nickname)
- where('lower(`nickname`) = ?', nickname.downcase).first
+ def find_by_nickname(nickname)
+ find_by('lower(`nickname`) = ?', nickname.downcase)
end
end
diff --git a/db/migrate/20131019133109_devise_create_users.rb b/db/migrate/20131019133109_devise_create_users.rb
index 156e258d..c87e3306 100644
--- a/db/migrate/20131019133109_devise_create_users.rb
+++ b/db/migrate/20131019133109_devise_create_users.rb
@@ -33,11 +33,11 @@ def change
# t.datetime :locked_at
t.timestamps
- end
- add_index :users, :email, unique: true
- add_index :users, :reset_password_token, unique: true
- # add_index :users, :confirmation_token, :unique => true
- # add_index :users, :unlock_token, :unique => true
+ t.index :email, unique: true
+ t.index :reset_password_token, unique: true
+ # t.index :confirmation_token, unique: true
+ # t.index :unlock_token, unique: true
+ end
end
end
diff --git a/db/migrate/20131019133235_add_columns_to_users.rb b/db/migrate/20131019133235_add_columns_to_users.rb
index 8e06d45a..781b1f54 100644
--- a/db/migrate/20131019133235_add_columns_to_users.rb
+++ b/db/migrate/20131019133235_add_columns_to_users.rb
@@ -2,8 +2,10 @@
class AddColumnsToUsers < ActiveRecord::Migration[4.2]
def change
- add_column :users, :nickname, :string
- add_column :users, :name, :string
- add_column :users, :image, :string
+ change_table :users, bulk: true do |t|
+ t.column :nickname, :string
+ t.column :name, :string
+ t.column :image, :string
+ end
end
end
diff --git a/db/migrate/20131019175751_add_some_fields_to_projects.rb b/db/migrate/20131019175751_add_some_fields_to_projects.rb
index 7c28bdb9..959dbf6f 100644
--- a/db/migrate/20131019175751_add_some_fields_to_projects.rb
+++ b/db/migrate/20131019175751_add_some_fields_to_projects.rb
@@ -2,11 +2,13 @@
class AddSomeFieldsToProjects < ActiveRecord::Migration[4.2]
def change
- add_column :projects, :name, :string
- add_column :projects, :full_name, :string
- add_column :projects, :source_full_name, :string
- add_column :projects, :description, :string
- add_column :projects, :watchers_count, :integer
- add_column :projects, :language, :string
+ change_table :projects, bulk: true do |t|
+ t.column :name, :string
+ t.column :full_name, :string
+ t.column :source_full_name, :string
+ t.column :description, :string
+ t.column :watchers_count, :integer
+ t.column :language, :string
+ end
end
end
diff --git a/db/migrate/20131030142749_drop_deposit_from_tip.rb b/db/migrate/20131030142749_drop_deposit_from_tip.rb
index da281869..90044a69 100644
--- a/db/migrate/20131030142749_drop_deposit_from_tip.rb
+++ b/db/migrate/20131030142749_drop_deposit_from_tip.rb
@@ -1,7 +1,11 @@
# frozen_string_literal: true
class DropDepositFromTip < ActiveRecord::Migration[4.2]
- def change
+ def up
remove_column :tips, :deposit_id
end
+
+ def down
+ add_reference :tips, :deposit, index: true
+ end
end
diff --git a/db/migrate/20131212190037_add_cache_to_users.rb b/db/migrate/20131212190037_add_cache_to_users.rb
index 5e47b789..1ecedd08 100644
--- a/db/migrate/20131212190037_add_cache_to_users.rb
+++ b/db/migrate/20131212190037_add_cache_to_users.rb
@@ -2,7 +2,9 @@
class AddCacheToUsers < ActiveRecord::Migration[4.2]
def change
- add_column :users, :commits_count, :integer, default: 0
- add_column :users, :withdrawn_amount, :integer, limit: 8, default: 0
+ change_table :users, bulk: true do |t|
+ t.column :commits_count, :integer, default: 0
+ t.column :withdrawn_amount, :integer, limit: 8, default: 0
+ end
end
end
diff --git a/db/migrate/20140102095035_add_refunded_at_to_tips.rb b/db/migrate/20140102095035_add_refunded_at_to_tips.rb
index 05d80cb5..5653751d 100644
--- a/db/migrate/20140102095035_add_refunded_at_to_tips.rb
+++ b/db/migrate/20140102095035_add_refunded_at_to_tips.rb
@@ -1,8 +1,17 @@
# frozen_string_literal: true
class AddRefundedAtToTips < ActiveRecord::Migration[4.2]
- def change
- add_column :tips, :refunded_at, :timestamp
- remove_column :tips, :is_refunded, :boolean
+ def up
+ change_table :tips, bulk: true do |t|
+ t.column :refunded_at, :timestamp
+ t.remove :is_refunded
+ end
+ end
+
+ def down
+ change_table :tips, bulk: true do |t|
+ t.remove :refunded_at
+ t.column :is_refunded, :boolean
+ end
end
end
diff --git a/db/migrate/20140209041123_create_indexes_for_projects.rb b/db/migrate/20140209041123_create_indexes_for_projects.rb
index d51f16bf..8a3345c8 100644
--- a/db/migrate/20140209041123_create_indexes_for_projects.rb
+++ b/db/migrate/20140209041123_create_indexes_for_projects.rb
@@ -2,7 +2,9 @@
class CreateIndexesForProjects < ActiveRecord::Migration[4.2]
def change
- add_index :projects, :full_name, unique: true
- add_index :projects, :github_id, unique: true
+ change_table :projects, bulk: true do |t|
+ t.index :full_name, unique: true
+ t.index :github_id, unique: true
+ end
end
end
diff --git a/db/migrate/20140402082149_add_fee_size_to_deposits.rb b/db/migrate/20140402082149_add_fee_size_to_deposits.rb
index c335fd50..8811847b 100644
--- a/db/migrate/20140402082149_add_fee_size_to_deposits.rb
+++ b/db/migrate/20140402082149_add_fee_size_to_deposits.rb
@@ -5,9 +5,13 @@ class Deposit < ApplicationRecord
end
def change
- add_column :deposits, :fee_size, :float
- remove_column :deposits, :duration, :integer
reversible do |dir|
+ change_table :deposits, bulk: true do |t|
+ t.column :fee_size, :float
+ dir.up { t.remove :duration, :integer }
+ dir.down { t.column :duration }
+ end
+
# Update all existing deposits
dir.up { Deposit.update_all(fee_size: CONFIG['our_fee']) }
end
diff --git a/db/migrate/20140722092532_add_confirmation_fields_to_users.rb b/db/migrate/20140722092532_add_confirmation_fields_to_users.rb
index cb9fa533..5084b78f 100644
--- a/db/migrate/20140722092532_add_confirmation_fields_to_users.rb
+++ b/db/migrate/20140722092532_add_confirmation_fields_to_users.rb
@@ -2,9 +2,11 @@
class AddConfirmationFieldsToUsers < ActiveRecord::Migration[4.2]
def change
- add_column :users, :confirmed_at, :timestamp
- add_column :users, :confirmation_sent_at, :timestamp
- add_column :users, :confirmation_token, :string
- add_column :users, :unconfirmed_email, :string
+ change_table :users, bulk: true do |t|
+ t.column :confirmation_token, :string
+ t.column :confirmation_sent_at, :timestamp
+ t.column :confirmed_at, :timestamp
+ t.column :unconfirmed_email, :string
+ end
end
end
diff --git a/db/migrate/20140816062159_remove_paid_out_from_deposits.rb b/db/migrate/20140816062159_remove_paid_out_from_deposits.rb
index 240add45..e8cbff1e 100644
--- a/db/migrate/20140816062159_remove_paid_out_from_deposits.rb
+++ b/db/migrate/20140816062159_remove_paid_out_from_deposits.rb
@@ -1,8 +1,17 @@
# frozen_string_literal: true
class RemovePaidOutFromDeposits < ActiveRecord::Migration[4.2]
- def change
- remove_column :deposits, :paid_out, :integer, limit: 8
- remove_column :deposits, :paid_out_at, :datetime
+ def up
+ change_table :deposits, bulk: true do |t|
+ t.remove :paid_out
+ t.remove :paid_out_at
+ end
+ end
+
+ def down
+ change_table :deposits, bulk: true do |t|
+ t.add :paid_out, :integer, limit: 8
+ t.add :paid_out_at, :datetime
+ end
end
end
diff --git a/lib/tasks/cucumber.rake b/lib/tasks/cucumber.rake
index 28b9e8ad..e279deb6 100644
--- a/lib/tasks/cucumber.rake
+++ b/lib/tasks/cucumber.rake
@@ -8,7 +8,7 @@
unless ARGV.any? { |a| a =~ /^gems/ } # Don't load anything when running the gems:* tasks
- vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
+ vendored_cucumber_bin = Dir[Rails.root.join('/vendor/{gems,plugins}/cucumber*/bin/cucumber')].first
$LOAD_PATH.unshift("#{File.dirname(vendored_cucumber_bin)}/../lib") unless vendored_cucumber_bin.nil?
begin
diff --git a/spec/misc_spec.rb b/spec/misc_spec.rb
index e8ff2b0e..bd3988b5 100644
--- a/spec/misc_spec.rb
+++ b/spec/misc_spec.rb
@@ -7,7 +7,7 @@
it 'has a flag image for each locale' do
locales.each do |locale|
- path = File.join(Rails.root, 'app', 'assets', 'images', 'flags', "#{locale}.png")
+ path = Rails.root.join("app/assets/images/flags/#{locale}.png")
expect(File.exist?(path)).to be_truthy, "#{locale} flag is missing"
end
end
From c3322dfdba67803004553add16742bb2f6cd4b8d Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 6 Dec 2020 12:04:30 +0100
Subject: [PATCH 088/159] updated schema
---
db/schema.rb | 225 +++++++++++++++++++++++++--------------------------
1 file changed, 109 insertions(+), 116 deletions(-)
diff --git a/db/schema.rb b/db/schema.rb
index 02ad5898..dd94d3c1 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1,6 +1,3 @@
-# encoding: UTF-8
-# frozen_string_literal: true
-
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
@@ -13,132 +10,128 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20170308163825) do
- create_table 'collaborators', force: :cascade do |t|
- t.integer 'project_id', limit: 4
- t.string 'login', limit: 255
- t.datetime 'created_at'
- t.datetime 'updated_at'
- end
-
- add_index 'collaborators', ['project_id'], name: 'index_collaborators_on_project_id', using: :btree
+ActiveRecord::Schema.define(version: 2017_03_08_163825) do
- create_table 'deposits', force: :cascade do |t|
- t.integer 'project_id', limit: 4
- t.string 'txid', limit: 255
- t.integer 'confirmations', limit: 4
- t.datetime 'created_at'
- t.datetime 'updated_at'
- t.integer 'amount', limit: 8
- t.float 'fee_size', limit: 24
+ create_table "collaborators", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
+ t.integer "project_id"
+ t.string "login"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.index ["project_id"], name: "index_collaborators_on_project_id"
end
- add_index 'deposits', ['project_id'], name: 'index_deposits_on_project_id', using: :btree
-
- create_table 'projects', force: :cascade do |t|
- t.string 'url', limit: 255
- t.string 'bitcoin_address', limit: 255
- t.datetime 'created_at'
- t.datetime 'updated_at'
- t.string 'name', limit: 255
- t.string 'full_name', limit: 255
- t.string 'source_full_name', limit: 255
- t.text 'description', limit: 65535
- t.integer 'watchers_count', limit: 4
- t.string 'language', limit: 255
- t.string 'last_commit', limit: 255
- t.integer 'available_amount_cache', limit: 4
- t.string 'github_id', limit: 255
- t.string 'host', limit: 255, default: 'github'
- t.boolean 'hold_tips', default: false
- t.datetime 'info_updated_at'
- t.string 'branch', limit: 255
- t.boolean 'disable_notifications'
- t.string 'avatar_url', limit: 255
- t.datetime 'deleted_at'
- t.string 'bitcoin_address2', limit: 255
- t.integer 'wallet_id', limit: 4
- t.string 'legacy_address', limit: 255
+ create_table "deposits", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
+ t.integer "project_id"
+ t.string "txid"
+ t.integer "confirmations"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.bigint "amount"
+ t.float "fee_size"
+ t.index ["project_id"], name: "index_deposits_on_project_id"
end
- add_index 'projects', ['full_name'], name: 'index_projects_on_full_name', unique: true, using: :btree
- add_index 'projects', ['github_id'], name: 'index_projects_on_github_id', unique: true, using: :btree
-
- create_table 'sendmanies', force: :cascade do |t|
- t.string 'txid', limit: 255
- t.text 'data', limit: 65535
- t.string 'result', limit: 255
- t.boolean 'is_error'
- t.datetime 'created_at'
- t.datetime 'updated_at'
+ create_table "projects", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
+ t.string "url"
+ t.string "bitcoin_address"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.string "name"
+ t.string "full_name"
+ t.string "source_full_name"
+ t.text "description"
+ t.integer "watchers_count"
+ t.string "language"
+ t.string "last_commit"
+ t.integer "available_amount_cache"
+ t.string "github_id"
+ t.string "host", default: "github"
+ t.boolean "hold_tips", default: false
+ t.datetime "info_updated_at"
+ t.string "branch"
+ t.boolean "disable_notifications"
+ t.string "avatar_url"
+ t.datetime "deleted_at"
+ t.string "bitcoin_address2"
+ t.integer "wallet_id"
+ t.string "legacy_address"
+ t.index ["full_name"], name: "index_projects_on_full_name", unique: true
+ t.index ["github_id"], name: "index_projects_on_github_id", unique: true
end
- create_table 'tipping_policies_texts', force: :cascade do |t|
- t.integer 'project_id', limit: 4
- t.integer 'user_id', limit: 4
- t.text 'text', limit: 65535
- t.datetime 'created_at'
- t.datetime 'updated_at'
+ create_table "sendmanies", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
+ t.string "txid"
+ t.text "data"
+ t.string "result"
+ t.boolean "is_error"
+ t.datetime "created_at"
+ t.datetime "updated_at"
end
- add_index 'tipping_policies_texts', ['project_id'], name: 'index_tipping_policies_texts_on_project_id', using: :btree
- add_index 'tipping_policies_texts', ['user_id'], name: 'index_tipping_policies_texts_on_user_id', using: :btree
-
- create_table 'tips', force: :cascade do |t|
- t.integer 'user_id', limit: 4
- t.integer 'amount', limit: 8
- t.integer 'sendmany_id', limit: 4
- t.datetime 'created_at'
- t.datetime 'updated_at'
- t.string 'commit', limit: 255
- t.integer 'project_id', limit: 4
- t.datetime 'refunded_at'
- t.text 'commit_message', limit: 65535
- t.datetime 'decided_at'
+ create_table "tipping_policies_texts", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
+ t.integer "project_id"
+ t.integer "user_id"
+ t.text "text"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.index ["project_id"], name: "index_tipping_policies_texts_on_project_id"
+ t.index ["user_id"], name: "index_tipping_policies_texts_on_user_id"
end
- add_index 'tips', ['project_id'], name: 'index_tips_on_project_id', using: :btree
- add_index 'tips', ['sendmany_id'], name: 'index_tips_on_sendmany_id', using: :btree
- add_index 'tips', ['user_id'], name: 'index_tips_on_user_id', using: :btree
-
- create_table 'users', force: :cascade do |t|
- t.string 'email', limit: 255, default: '', null: false
- t.string 'encrypted_password', limit: 255, default: '', null: false
- t.string 'reset_password_token', limit: 255
- t.datetime 'reset_password_sent_at'
- t.datetime 'remember_created_at'
- t.integer 'sign_in_count', limit: 4, default: 0, null: false
- t.datetime 'current_sign_in_at'
- t.datetime 'last_sign_in_at'
- t.string 'current_sign_in_ip', limit: 255
- t.string 'last_sign_in_ip', limit: 255
- t.datetime 'created_at'
- t.datetime 'updated_at'
- t.string 'nickname', limit: 255
- t.string 'name', limit: 255
- t.string 'image', limit: 255
- t.string 'bitcoin_address', limit: 255
- t.string 'login_token', limit: 255
- t.boolean 'unsubscribed'
- t.datetime 'notified_at'
- t.integer 'commits_count', limit: 4, default: 0
- t.integer 'withdrawn_amount', limit: 8, default: 0
- t.datetime 'confirmed_at'
- t.datetime 'confirmation_sent_at'
- t.string 'confirmation_token', limit: 255
- t.string 'unconfirmed_email', limit: 255
- t.string 'display_name', limit: 255
- t.integer 'denom', limit: 4, default: 0
+ create_table "tips", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
+ t.integer "user_id"
+ t.bigint "amount"
+ t.integer "sendmany_id"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.string "commit"
+ t.integer "project_id"
+ t.datetime "refunded_at"
+ t.text "commit_message"
+ t.datetime "decided_at"
+ t.index ["project_id"], name: "index_tips_on_project_id"
+ t.index ["sendmany_id"], name: "index_tips_on_sendmany_id"
+ t.index ["user_id"], name: "index_tips_on_user_id"
end
- add_index 'users', ['email'], name: 'index_users_on_email', unique: true, using: :btree
- add_index 'users', ['reset_password_token'], name: 'index_users_on_reset_password_token', unique: true, using: :btree
+ create_table "users", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
+ t.string "email", default: "", null: false
+ t.string "encrypted_password", default: "", null: false
+ t.string "reset_password_token"
+ t.datetime "reset_password_sent_at"
+ t.datetime "remember_created_at"
+ t.integer "sign_in_count", default: 0, null: false
+ t.datetime "current_sign_in_at"
+ t.datetime "last_sign_in_at"
+ t.string "current_sign_in_ip"
+ t.string "last_sign_in_ip"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.string "nickname"
+ t.string "name"
+ t.string "image"
+ t.string "bitcoin_address"
+ t.string "login_token"
+ t.boolean "unsubscribed"
+ t.datetime "notified_at"
+ t.integer "commits_count", default: 0
+ t.bigint "withdrawn_amount", default: 0
+ t.datetime "confirmed_at"
+ t.datetime "confirmation_sent_at"
+ t.string "confirmation_token"
+ t.string "unconfirmed_email"
+ t.string "display_name"
+ t.integer "denom", default: 0
+ t.index ["email"], name: "index_users_on_email", unique: true
+ t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
+ end
- create_table 'wallets', force: :cascade do |t|
- t.string 'name', limit: 255
- t.string 'xpub', limit: 255
- t.integer 'last_address_index', limit: 4, default: 1
- t.datetime 'created_at', null: false
- t.datetime 'updated_at', null: false
+ create_table "wallets", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
+ t.string "name"
+ t.string "xpub"
+ t.integer "last_address_index", default: 1
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
end
+
end
From 4d6900d0afefbe8cd3a0389fda9714a41caa008b Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 6 Dec 2020 12:41:59 +0100
Subject: [PATCH 089/159] reduced complexity
---
.rubocop_todo.yml | 22 ++--
app/helpers/application_helper.rb | 165 ------------------------------
app/helpers/rates_helper.rb | 134 ++++++++++++++++++++++++
app/views/users/show.html.haml | 4 +-
4 files changed, 145 insertions(+), 180 deletions(-)
create mode 100644 app/helpers/rates_helper.rb
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 2975e513..4d936c8e 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -1,15 +1,15 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
-# on 2020-12-06 10:56:23 UTC using RuboCop version 1.5.2.
+# on 2020-12-06 11:41:05 UTC using RuboCop version 1.5.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
-# Offense count: 18
+# Offense count: 17
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
Metrics/AbcSize:
- Max: 51
+ Max: 34
# Offense count: 17
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
@@ -22,22 +22,17 @@ Metrics/BlockLength:
Metrics/ClassLength:
Max: 187
-# Offense count: 4
+# Offense count: 3
# Configuration parameters: IgnoredMethods.
Metrics/CyclomaticComplexity:
- Max: 29
+ Max: 16
-# Offense count: 19
+# Offense count: 18
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
Metrics/MethodLength:
- Max: 57
-
-# Offense count: 1
-# Configuration parameters: CountComments, CountAsOne.
-Metrics/ModuleLength:
- Max: 163
+ Max: 29
-# Offense count: 4
+# Offense count: 3
# Configuration parameters: IgnoredMethods.
Metrics/PerceivedComplexity:
Max: 13
@@ -150,6 +145,7 @@ Rails/HasManyOrHasOneDependent:
Rails/OutputSafety:
Exclude:
- 'app/helpers/application_helper.rb'
+ - 'app/helpers/rates_helper.rb'
# Offense count: 11
# Configuration parameters: ForbiddenMethods, AllowedMethods.
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 5380ae7d..835a0fdd 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1,171 +1,6 @@
# frozen_string_literal: true
module ApplicationHelper
- def btc_human(amount, options = {})
- amount ||= 0
- nobr = options.key?(:nobr) ? options[:nobr] : true
- denom = if options.key?(:denom)
- options[:denom]
- else
- (try(:current_user) ? current_user.denom : 0)
- end
- case denom
- when 0
- btc = to_btc(amount)
- when 1
- btc = to_mbtc(amount)
- when 2
- btc = to_ubtc(amount)
- when 3
- btc = to_satoshi(amount)
- when 4
- btc = to_usd(amount)
- when 5
- btc = to_eur(amount)
- when 6
- btc = to_aud(amount)
- when 7
- btc = to_brl(amount)
- when 8
- btc = to_cad(amount)
- when 9
- btc = to_cny(amount)
- when 10
- btc = to_gbp(amount)
- when 11
- btc = to_idr(amount)
- when 12
- btc = to_ils(amount)
- when 13
- btc = to_jpy(amount)
- when 14
- btc = to_mxn(amount)
- when 15
- btc = to_nok(amount)
- when 16
- btc = to_nzd(amount)
- when 17
- btc = to_pln(amount)
- when 18
- btc = to_ron(amount)
- when 19
- btc = to_rub(amount)
- when 20
- btc = to_sek(amount)
- when 21
- btc = to_sgd(amount)
- when 22
- btc = to_zar(amount)
- end
- btc = "#{btc}" if nobr
- btc.html_safe
- end
-
- def to_btc(satoshies)
- format('%.8f Ƀ', (1.0 * satoshies.to_i / 1e8))
- end
-
- def to_mbtc(satoshies)
- format('%.5f mɃ', (1.0 * satoshies.to_i / 1e5))
- end
-
- def to_ubtc(satoshies)
- format('%.2f μɃ', (1.0 * satoshies.to_i / 1e2))
- end
-
- def to_satoshi(satoshies)
- format('%.0f Satoshi', satoshies)
- end
-
- def to_usd(satoshies)
- format('$%.2f', rate('USD', satoshies))
- end
-
- def to_aud(satoshies)
- format('$%.2f', rate('AUD', satoshies))
- end
-
- def to_eur(satoshies)
- format('%.2f€', rate('EUR', satoshies))
- end
-
- def to_brl(satoshies)
- format('R$%.2f', rate('BRL', satoshies))
- end
-
- def to_cad(satoshies)
- format('$%.2f', rate('CAD', satoshies))
- end
-
- def to_cny(satoshies)
- format('%.2f¥', rate('CNY', satoshies))
- end
-
- def to_gbp(satoshies)
- format('%.2f£', rate('GBP', satoshies))
- end
-
- def to_idr(satoshies)
- format('%.2f Rp', rate('IDR', satoshies))
- end
-
- def to_ils(satoshies)
- format('%.2f₪', rate('ILS', satoshies))
- end
-
- def to_jpy(satoshies)
- format('%.2f¥', rate('JPY', satoshies))
- end
-
- def to_mxn(satoshies)
- format('%.2f MXN', rate('MXN', satoshies))
- end
-
- def to_nok(satoshies)
- format('%.2f kr', rate('NOK', satoshies))
- end
-
- def to_nzd(satoshies)
- format('$%.2f', rate('NZD', satoshies))
- end
-
- def to_pln(satoshies)
- format('%.2f zł', rate('PLN', satoshies))
- end
-
- def to_ron(satoshies)
- format('%.2f lei', rate('RON', satoshies))
- end
-
- def to_rub(satoshies)
- format('%.2f₽', rate('RUB', satoshies))
- end
-
- def to_sek(satoshies)
- format('%.2f kr', rate('SEK', satoshies))
- end
-
- def to_sgd(satoshies)
- format('%.2f S$', rate('SGD', satoshies))
- end
-
- def to_zar(satoshies)
- format('%.2f R', rate('ZAR', satoshies))
- end
-
- def rate(currency, satoshies)
- satoshies * 0.00000001 * get_rate(currency)
- end
-
- def get_rate(currency)
- Rails.cache.fetch("####{currency}", expires_in: 1.hour) do
- uri = URI("https://api.coindesk.com/v1/bpi/currentprice/#{currency}.json")
- response = Net::HTTP.get_response(uri)
- hash = JSON.parse(response.body)
- hash['bpi'][currency]['rate_float'].to_f
- end
- end
-
def render_flash_messages
html = []
flash.each do |type, message|
diff --git a/app/helpers/rates_helper.rb b/app/helpers/rates_helper.rb
new file mode 100644
index 00000000..537af960
--- /dev/null
+++ b/app/helpers/rates_helper.rb
@@ -0,0 +1,134 @@
+# frozen_string_literal: true
+
+module RatesHelper
+ DENOMINATIONS = %w[
+ BTC mBTC μBTC Satoshi USD EUR AUD BRL CAD CNY GBP IDR ILS JPY MXN NOK NZD PLN RON RUB SEK SGD ZAR
+ ].freeze
+
+ def denom_options_for_select
+ # [["BTC", "0"], ["mBTC", "1"], ...
+ DENOMINATIONS.each_with_index.map { |label, index| [label, index.to_s] }
+ end
+
+ def btc_human(amount, options = {})
+ nobr = options.key?(:nobr) ? options[:nobr] : true
+ denom = options.key?(:denom) ? options[:denom] : current_user&.denom || 0
+
+ btc = to_denom(denom, amount)
+ btc = "#{btc}" if nobr
+ btc.html_safe
+ end
+
+ private
+
+ def to_denom(denom, amount)
+ amount ||= 0
+ convert_method_name = "to_#{DENOMINATIONS[denom].gsub('μ', 'u').downcase}"
+ send(convert_method_name, amount)
+ end
+
+ def to_btc(satoshies)
+ format('%.8f Ƀ', (1.0 * satoshies.to_i / 1e8))
+ end
+
+ def to_mbtc(satoshies)
+ format('%.5f mɃ', (1.0 * satoshies.to_i / 1e5))
+ end
+
+ def to_ubtc(satoshies)
+ format('%.2f μɃ', (1.0 * satoshies.to_i / 1e2))
+ end
+
+ def to_satoshi(satoshies)
+ format('%.0f Satoshi', satoshies)
+ end
+
+ def to_usd(satoshies)
+ format('$%.2f', rate('USD', satoshies))
+ end
+
+ def to_aud(satoshies)
+ format('$%.2f', rate('AUD', satoshies))
+ end
+
+ def to_eur(satoshies)
+ format('%.2f€', rate('EUR', satoshies))
+ end
+
+ def to_brl(satoshies)
+ format('R$%.2f', rate('BRL', satoshies))
+ end
+
+ def to_cad(satoshies)
+ format('$%.2f', rate('CAD', satoshies))
+ end
+
+ def to_cny(satoshies)
+ format('%.2f¥', rate('CNY', satoshies))
+ end
+
+ def to_gbp(satoshies)
+ format('%.2f£', rate('GBP', satoshies))
+ end
+
+ def to_idr(satoshies)
+ format('%.2f Rp', rate('IDR', satoshies))
+ end
+
+ def to_ils(satoshies)
+ format('%.2f₪', rate('ILS', satoshies))
+ end
+
+ def to_jpy(satoshies)
+ format('%.2f¥', rate('JPY', satoshies))
+ end
+
+ def to_mxn(satoshies)
+ format('%.2f MXN', rate('MXN', satoshies))
+ end
+
+ def to_nok(satoshies)
+ format('%.2f kr', rate('NOK', satoshies))
+ end
+
+ def to_nzd(satoshies)
+ format('$%.2f', rate('NZD', satoshies))
+ end
+
+ def to_pln(satoshies)
+ format('%.2f zł', rate('PLN', satoshies))
+ end
+
+ def to_ron(satoshies)
+ format('%.2f lei', rate('RON', satoshies))
+ end
+
+ def to_rub(satoshies)
+ format('%.2f₽', rate('RUB', satoshies))
+ end
+
+ def to_sek(satoshies)
+ format('%.2f kr', rate('SEK', satoshies))
+ end
+
+ def to_sgd(satoshies)
+ format('%.2f S$', rate('SGD', satoshies))
+ end
+
+ def to_zar(satoshies)
+ format('%.2f R', rate('ZAR', satoshies))
+ end
+
+ def rate(currency, satoshies)
+ satoshies * 0.00000001 * get_rate(currency)
+ end
+
+ def get_rate(currency)
+ Rails.cache.fetch("####{currency}", expires_in: 1.hour) do
+ uri = URI("https://api.coindesk.com/v1/bpi/currentprice/#{currency}.json")
+ response = Net::HTTP.get_response(uri)
+ hash = JSON.parse(response.body)
+ hash['bpi'][currency]['rate_float'].to_f
+ end
+ end
+end
diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml
index 44b97a64..2ae12731 100644
--- a/app/views/users/show.html.haml
+++ b/app/views/users/show.html.haml
@@ -5,7 +5,7 @@
= btc_human @user.balance
= form_for(@user) do |f|
= f.select :denom,
- options_for_select([["BTC", "0"], ["mBTC", "1"], ["μBTC", "2"], ["Satoshi", "3"], ["USD", "4"], ["EUR", "5"], ["AUD", "6"], ["BRL", "7"], ["CAD", "8"], ["CNY", "9"], ["GBP", "10"], ["IDR", "11"], ["ILS", "12"], ["JPY", "13"], ["MXN", "14"], ["NOK", "15"], ["NZD", "16"], ["PLN", "17"], ["RON", "18"], ["RUB", "19"], ["SEK", "20"], ["SGD", "21"], ["ZAR", "22"]], selected: @user.denom)
+ options_for_select(denom_options_for_select, selected: @user.denom)
= f.submit "save"
%p
%small= raw t('.threshold', threshold: btc_human(CONFIG["min_payout"]))
@@ -53,4 +53,4 @@
= bootstrap_form_for @user, html: {class: (params[:delete_user] ? '' : 'collapse'), id: 'delete_user_form', method: 'DELETE'} do |f|
%p= t('.delete_account_notice')
= f.text_field :email, value: '', autocomplete: "off"
- = f.submit t('.delete_account_confirm'), class: 'btn btn-danger'
\ No newline at end of file
+ = f.submit t('.delete_account_confirm'), class: 'btn btn-danger'
From ff7ff2ec81f381c8305a3654f19b603a167f2c40 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 6 Dec 2020 18:33:49 +0100
Subject: [PATCH 090/159] refactored omniauth controller
---
.rubocop_todo.yml | 10 ++---
.../users/omniauth_callbacks_controller.rb | 40 ++++++++++---------
2 files changed, 27 insertions(+), 23 deletions(-)
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 4d936c8e..02fa5094 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -1,12 +1,12 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
-# on 2020-12-06 11:41:05 UTC using RuboCop version 1.5.2.
+# on 2020-12-06 17:32:53 UTC using RuboCop version 1.5.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
-# Offense count: 17
+# Offense count: 16
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 34
@@ -22,17 +22,17 @@ Metrics/BlockLength:
Metrics/ClassLength:
Max: 187
-# Offense count: 3
+# Offense count: 2
# Configuration parameters: IgnoredMethods.
Metrics/CyclomaticComplexity:
Max: 16
-# Offense count: 18
+# Offense count: 17
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
Metrics/MethodLength:
Max: 29
-# Offense count: 3
+# Offense count: 2
# Configuration parameters: IgnoredMethods.
Metrics/PerceivedComplexity:
Max: 13
diff --git a/app/controllers/users/omniauth_callbacks_controller.rb b/app/controllers/users/omniauth_callbacks_controller.rb
index ca40bf05..c5f0984c 100644
--- a/app/controllers/users/omniauth_callbacks_controller.rb
+++ b/app/controllers/users/omniauth_callbacks_controller.rb
@@ -2,32 +2,36 @@
module Users
class OmniauthCallbacksController < Devise::OmniauthCallbacksController
- before_action :load_omniauth_info, only: :github
+ before_action :load_omniauth_info,
+ :load_user_from_omniauth_info,
+ :update_user_from_omniauth_info, only: :github
def github
- @user = User.find_by(nickname: @omniauth_info.nickname) ||
- User.find_by(email: @omniauth_info.email)
-
- if @user.present?
- if @omniauth_info.email.present? && @user.email != @omniauth_info.email
- # update email if it has been changed
- @user.update email: @omniauth_info.email
- end
- elsif @omniauth_info.email.present? # user not found
- @user = User.create_with_omniauth!(@omniauth_info)
- else
- set_flash_message(:error, :failure, kind: 'GitHub', reason: I18n.t('devise.errors.primary_email'))
- redirect_to new_user_session_path and return
- end
-
- @user.update(@omniauth_info.slice(:name, :image).as_json)
-
sign_in_and_redirect @user, event: :authentication
set_flash_message(:notice, :success, kind: 'GitHub') if is_navigational_format?
end
private
+ def update_user_from_omniauth_info
+ update_hash = @omniauth_info.slice(:name, :image).as_json
+ update_hash[:email] = @omniauth_info.email if @omniauth_info.email.present?
+
+ @user.update(update_hash)
+ end
+
+ def load_user_from_omniauth_info
+ @user = User.find_by(nickname: @omniauth_info.nickname) ||
+ User.find_by(email: @omniauth_info.email)
+ return if @user
+
+ @user = User.create_with_omniauth!(@omniauth_info) if @omniauth_info.email.present?
+ return if @user
+
+ set_flash_message(:error, :failure, kind: 'GitHub', reason: I18n.t('devise.errors.primary_email'))
+ redirect_to new_user_session_path
+ end
+
def load_omniauth_info
@omniauth_info = request.env['omniauth.auth']['info']
return if @omniauth_info
From 1701f4cdfb27989a8a07d7f44f2bbea6f6050261 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 6 Dec 2020 19:09:45 +0100
Subject: [PATCH 091/159] rubocop fixes
---
.rubocop_todo.yml | 40 +-----
spec/controllers/deposits_controller_spec.rb | 9 --
spec/controllers/home_controller_spec.rb | 32 -----
spec/controllers/projects_controller_spec.rb | 125 +-----------------
spec/controllers/tips_controller_spec.rb | 9 --
spec/controllers/users_controller_spec.rb | 64 ---------
.../withdrawals_controller_spec.rb | 9 --
spec/{misc_spec.rb => features/assets.rb} | 2 +-
spec/models/send_many_spec.rb | 9 --
spec/routing/deposits_routing_spec.rb | 12 ++
spec/routing/home_routing_spec.rb | 28 ++++
spec/routing/projects_routing_spec.rb | 124 +++++++++++++++++
spec/routing/tips_routing_spec.rb | 12 ++
spec/routing/users_routing_spec.rb | 67 ++++++++++
spec/routing/withdrawals_routing_spec.rb | 12 ++
15 files changed, 264 insertions(+), 290 deletions(-)
rename spec/{misc_spec.rb => features/assets.rb} (90%)
delete mode 100644 spec/models/send_many_spec.rb
create mode 100644 spec/routing/deposits_routing_spec.rb
create mode 100644 spec/routing/home_routing_spec.rb
create mode 100644 spec/routing/projects_routing_spec.rb
create mode 100644 spec/routing/tips_routing_spec.rb
create mode 100644 spec/routing/users_routing_spec.rb
create mode 100644 spec/routing/withdrawals_routing_spec.rb
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 02fa5094..708ba3d1 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
-# on 2020-12-06 17:32:53 UTC using RuboCop version 1.5.2.
+# on 2020-12-06 18:08:51 UTC using RuboCop version 1.5.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
@@ -11,11 +11,11 @@
Metrics/AbcSize:
Max: 34
-# Offense count: 17
+# Offense count: 15
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
# IgnoredMethods: refine
Metrics/BlockLength:
- Max: 224
+ Max: 117
# Offense count: 2
# Configuration parameters: CountComments, CountAsOne.
@@ -47,45 +47,22 @@ Naming/PredicateName:
Exclude:
- 'app/models/project.rb'
-# Offense count: 3
+# Offense count: 1
# Configuration parameters: Prefixes.
# Prefixes: when, with, without
RSpec/ContextWording:
Exclude:
- 'spec/controllers/projects_controller_spec.rb'
-# Offense count: 1
-# Configuration parameters: IgnoredMetadata.
-RSpec/DescribeClass:
- Exclude:
- - 'spec/misc_spec.rb'
-
# Offense count: 13
# Configuration parameters: Max.
RSpec/ExampleLength:
Exclude:
- 'spec/controllers/projects_controller_spec.rb'
- - 'spec/controllers/users_controller_spec.rb'
- 'spec/lib/blacklist_spec.rb'
- 'spec/models/deposit_spec.rb'
-
-# Offense count: 25
-# Cop supports --auto-correct.
-RSpec/ExpectActual:
- Exclude:
- - 'spec/controllers/deposits_controller_spec.rb'
- - 'spec/controllers/home_controller_spec.rb'
- - 'spec/controllers/projects_controller_spec.rb'
- - 'spec/controllers/tips_controller_spec.rb'
- - 'spec/controllers/users_controller_spec.rb'
- - 'spec/controllers/withdrawals_controller_spec.rb'
-
-# Offense count: 1
-# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
-# Include: **/*_spec*rb*, **/spec/**/*
-RSpec/FilePath:
- Exclude:
- - 'spec/models/send_many_spec.rb'
+ - 'spec/routing/projects_routing_spec.rb'
+ - 'spec/routing/users_routing_spec.rb'
# Offense count: 2
# Configuration parameters: AssignmentOnly.
@@ -117,11 +94,6 @@ RSpec/NamedSubject:
RSpec/NestedGroups:
Max: 5
-# Offense count: 2
-RSpec/RepeatedExample:
- Exclude:
- - 'spec/controllers/home_controller_spec.rb'
-
# Offense count: 2
RSpec/RepeatedExampleGroupBody:
Exclude:
diff --git a/spec/controllers/deposits_controller_spec.rb b/spec/controllers/deposits_controller_spec.rb
index 287e58bf..40f18930 100644
--- a/spec/controllers/deposits_controller_spec.rb
+++ b/spec/controllers/deposits_controller_spec.rb
@@ -9,13 +9,4 @@
expect(response).to be_successful
end
end
-
- describe 'routing' do
- it 'routes GET / to Deposits#index' do
- expect({ get: '/deposits' }).to route_to(
- controller: 'deposits',
- action: 'index'
- )
- end
- end
end
diff --git a/spec/controllers/home_controller_spec.rb b/spec/controllers/home_controller_spec.rb
index 8a6b1e79..09c20eed 100644
--- a/spec/controllers/home_controller_spec.rb
+++ b/spec/controllers/home_controller_spec.rb
@@ -14,36 +14,4 @@
expect(subject.status).to eq 200
end
end
-
- describe 'routing' do
- it 'routes GET / to Home#index' do
- expect({ get: '/' }).to route_to(
- controller: 'home',
- action: 'index'
- )
- end
-
- it 'routes GET /home to Home#index' do
- expect({ get: '/' }).to route_to(
- controller: 'home',
- action: 'index'
- )
- end
-
- it 'routes GET /users/999999/no-such-path to Home#index' do
- expect({ get: '/users/999999/no-such-path' }).to route_to(
- controller: 'home',
- action: 'index',
- path: 'users/999999/no-such-path'
- )
- end
-
- it 'routes GET /any/non-existent/path to Home#index' do
- expect({ get: '/any/non-existent/path' }).to route_to(
- controller: 'home',
- action: 'index',
- path: 'any/non-existent/path'
- )
- end
- end
end
diff --git a/spec/controllers/projects_controller_spec.rb b/spec/controllers/projects_controller_spec.rb
index 11f8347f..c166f257 100644
--- a/spec/controllers/projects_controller_spec.rb
+++ b/spec/controllers/projects_controller_spec.rb
@@ -71,7 +71,7 @@
shared_context 'accessing_project' do |verb, action|
let(:a_project) { create :project, host: 'github', full_name: 'test/test' }
- context 'existing_project' do
+ context 'with existsing project' do
it 'via project id returns 302 status code' do
case verb
when :get
@@ -93,7 +93,7 @@
end
end
- context 'nonexisting_project' do
+ context 'with non-existing project' do
it 'via project id returns 302 status code' do
case verb
when :get
@@ -158,125 +158,4 @@
expect(response).to be_redirect
end
end
-
- describe 'routing' do
- it 'routes GET /projects to Project#index' do
- expect({ get: '/projects' }).to route_to(
- controller: 'projects',
- action: 'index'
- )
- end
-
- it 'routes GET /projects/search?query= to Project#search' do
- expect({ get: '/projects/search?query=seldon&order=balance' }).to route_to(
- controller: 'projects',
- action: 'search',
- query: 'seldon',
- order: 'balance'
- )
- end
-
- it 'routes GET /projects/1 to Project#show' do
- expect({ get: '/projects/1' }).to route_to(
- controller: 'projects',
- action: 'show',
- id: '1'
- )
- end
-
- it 'routes GET /projects/1/edit to Project#edit' do
- expect({ get: '/projects/1/edit' }).to route_to(
- controller: 'projects',
- action: 'edit',
- id: '1'
- )
- end
-
- it 'routes PUT /projects/1 to Project#update' do
- expect({ put: '/projects/1' }).to route_to(
- controller: 'projects',
- action: 'update',
- id: '1'
- )
- end
-
- it 'routes GET /projects/1/decide_tip_amounts to Project#decide_tip_amounts' do
- expect({ get: '/projects/1/decide_tip_amounts' }).to route_to(
- controller: 'projects',
- action: 'decide_tip_amounts',
- id: '1'
- )
- end
-
- it 'routes PATCH /projects/1/decide_tip_amounts to Project#decide_tip_amounts' do
- expect({ patch: '/projects/1/decide_tip_amounts' }).to route_to(
- controller: 'projects',
- action: 'decide_tip_amounts',
- id: '1'
- )
- end
-
- it 'routes GET /projects/1/tips to Tips#index' do
- expect({ get: '/projects/1/tips' }).to route_to(
- controller: 'tips',
- action: 'index',
- project_id: '1'
- )
- end
-
- it 'routes GET /projects/1/deposits to Deposits#index' do
- expect({ get: '/projects/1/deposits' }).to route_to(
- controller: 'deposits',
- action: 'index',
- project_id: '1'
- )
- end
- end
-
- describe 'Project pretty url routing' do
- it 'routes GET /:provider/:repo to Project#show' do
- expect({ get: '/github/test/test' }).to route_to(
- controller: 'projects',
- action: 'show',
- service: 'github',
- repo: 'test/test'
- )
- end
-
- it 'routes GET /:provider/:repo/edit to Project#edit' do
- expect({ get: '/github/test/test/edit' }).to route_to(
- controller: 'projects',
- action: 'edit',
- service: 'github',
- repo: 'test/test'
- )
- end
-
- it 'routes GET /:provider/:repo/decide_tip_amounts to Project#decide_tip_amounts' do
- expect({ get: '/github/test/test/decide_tip_amounts' }).to route_to(
- controller: 'projects',
- action: 'decide_tip_amounts',
- service: 'github',
- repo: 'test/test'
- )
- end
-
- it 'routes GET /:provider/:repo/tips to Project#tips' do
- expect({ get: '/github/test/test/tips' }).to route_to(
- controller: 'tips',
- action: 'index',
- service: 'github',
- repo: 'test/test'
- )
- end
-
- it 'routes GET /:provider/:repo/deposits to Project#deposits' do
- expect({ get: '/github/test/test/deposits' }).to route_to(
- controller: 'deposits',
- action: 'index',
- service: 'github',
- repo: 'test/test'
- )
- end
- end
end
diff --git a/spec/controllers/tips_controller_spec.rb b/spec/controllers/tips_controller_spec.rb
index d060ccf2..c64e8395 100644
--- a/spec/controllers/tips_controller_spec.rb
+++ b/spec/controllers/tips_controller_spec.rb
@@ -9,13 +9,4 @@
expect(response).to be_successful
end
end
-
- describe 'routing' do
- it 'routes GET / to Tips#index' do
- expect({ get: '/tips' }).to route_to(
- controller: 'tips',
- action: 'index'
- )
- end
- end
end
diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb
index c9c52616..3cc59d1f 100644
--- a/spec/controllers/users_controller_spec.rb
+++ b/spec/controllers/users_controller_spec.rb
@@ -95,68 +95,4 @@
end
end
end
-
- describe 'routing' do
- it 'routes GET /users to User#index' do
- expect({ get: '/users' }).to route_to(
- controller: 'users',
- action: 'index'
- )
- end
-
- it 'routes GET /users/nick-name321 to User#show' do
- expect({ get: '/users/nick-name321' }).to route_to(
- controller: 'users',
- action: 'show',
- nickname: 'nick-name321'
- )
- end
-
- it 'routes GET /users/login to User#login' do
- expect({ get: '/users/login' }).to route_to(
- controller: 'users',
- action: 'login'
- )
- end
-
- it 'routes GET /users/1/tips to Tips#index' do
- expect({ get: '/users/1/tips' }).to route_to(
- controller: 'tips',
- action: 'index',
- user_id: '1'
- )
- end
- end
-
- describe 'pretty url routing' do
- let(:user) { create(:user) }
-
- it 'regex rejects reserved user paths' do
- # accepted pertty url usernames
- should_accept = [' ', 'logi', 'ogin', 's4c2', '42x', 'nick name', 'kd']
- # reserved routes (rejected pertty url usernames)
- should_reject = ['', '1', '42']
-
- accepted = should_accept.select { |ea| ea =~ /\D+/ }
- rejected = should_reject.select { |ea| (ea =~ /\D+/).nil? }
- (expect(accepted.size).to eq(should_accept.size)) &&
- (expect(rejected.size).to eq(should_reject.size))
- end
-
- it 'routes GET /users/:nickname to User#show' do
- expect({ get: "/users/#{user.nickname}" }).to route_to(
- controller: 'users',
- action: 'show',
- nickname: 'kd'
- )
- end
-
- it 'routes GET /users/:nickname/tips to Tips#index' do
- expect({ get: "/users/#{user.nickname}/tips" }).to route_to(
- controller: 'tips',
- action: 'index',
- nickname: 'kd'
- )
- end
- end
end
diff --git a/spec/controllers/withdrawals_controller_spec.rb b/spec/controllers/withdrawals_controller_spec.rb
index d1db2351..6bbbea1f 100644
--- a/spec/controllers/withdrawals_controller_spec.rb
+++ b/spec/controllers/withdrawals_controller_spec.rb
@@ -9,13 +9,4 @@
expect(response).to be_successful
end
end
-
- describe 'routing' do
- it 'routes GET / to Withdrawals#index' do
- expect({ get: '/withdrawals' }).to route_to(
- controller: 'withdrawals',
- action: 'index'
- )
- end
- end
end
diff --git a/spec/misc_spec.rb b/spec/features/assets.rb
similarity index 90%
rename from spec/misc_spec.rb
rename to spec/features/assets.rb
index bd3988b5..1814fabb 100644
--- a/spec/misc_spec.rb
+++ b/spec/features/assets.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Misc tets' do
+describe 'Assets', type: :feature do
let(:locales) { Rails.application.config.available_locales }
it 'has a flag image for each locale' do
diff --git a/spec/models/send_many_spec.rb b/spec/models/send_many_spec.rb
deleted file mode 100644
index 428efb30..00000000
--- a/spec/models/send_many_spec.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-describe Sendmany, type: :model do
- describe 'Associations' do
- it { is_expected.to have_many :tips }
- end
-end
diff --git a/spec/routing/deposits_routing_spec.rb b/spec/routing/deposits_routing_spec.rb
new file mode 100644
index 00000000..8289c3aa
--- /dev/null
+++ b/spec/routing/deposits_routing_spec.rb
@@ -0,0 +1,12 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe 'routes for Deposits', type: :routing do
+ it 'routes GET / to Deposits#index' do
+ expect({ get: '/deposits' }).to route_to(
+ controller: 'deposits',
+ action: 'index'
+ )
+ end
+end
diff --git a/spec/routing/home_routing_spec.rb b/spec/routing/home_routing_spec.rb
new file mode 100644
index 00000000..b8c3e81d
--- /dev/null
+++ b/spec/routing/home_routing_spec.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe 'routes for Home', type: :routing do
+ it 'routes GET / to Home#index' do
+ expect({ get: '/' }).to route_to(
+ controller: 'home',
+ action: 'index'
+ )
+ end
+
+ it 'routes GET /users/999999/no-such-path to Home#index' do
+ expect({ get: '/users/999999/no-such-path' }).to route_to(
+ controller: 'home',
+ action: 'index',
+ path: 'users/999999/no-such-path'
+ )
+ end
+
+ it 'routes GET /any/non-existent/path to Home#index' do
+ expect({ get: '/any/non-existent/path' }).to route_to(
+ controller: 'home',
+ action: 'index',
+ path: 'any/non-existent/path'
+ )
+ end
+end
diff --git a/spec/routing/projects_routing_spec.rb b/spec/routing/projects_routing_spec.rb
new file mode 100644
index 00000000..41d1040f
--- /dev/null
+++ b/spec/routing/projects_routing_spec.rb
@@ -0,0 +1,124 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe 'routes for Projects', type: :routing do
+ it 'routes GET /projects to Project#index' do
+ expect({ get: '/projects' }).to route_to(
+ controller: 'projects',
+ action: 'index'
+ )
+ end
+
+ it 'routes GET /projects/search?query= to Project#search' do
+ expect({ get: '/projects/search?query=seldon&order=balance' }).to route_to(
+ controller: 'projects',
+ action: 'search',
+ query: 'seldon',
+ order: 'balance'
+ )
+ end
+
+ it 'routes GET /projects/1 to Project#show' do
+ expect({ get: '/projects/1' }).to route_to(
+ controller: 'projects',
+ action: 'show',
+ id: '1'
+ )
+ end
+
+ it 'routes GET /projects/1/edit to Project#edit' do
+ expect({ get: '/projects/1/edit' }).to route_to(
+ controller: 'projects',
+ action: 'edit',
+ id: '1'
+ )
+ end
+
+ it 'routes PUT /projects/1 to Project#update' do
+ expect({ put: '/projects/1' }).to route_to(
+ controller: 'projects',
+ action: 'update',
+ id: '1'
+ )
+ end
+
+ it 'routes GET /projects/1/decide_tip_amounts to Project#decide_tip_amounts' do
+ expect({ get: '/projects/1/decide_tip_amounts' }).to route_to(
+ controller: 'projects',
+ action: 'decide_tip_amounts',
+ id: '1'
+ )
+ end
+
+ it 'routes PATCH /projects/1/decide_tip_amounts to Project#decide_tip_amounts' do
+ expect({ patch: '/projects/1/decide_tip_amounts' }).to route_to(
+ controller: 'projects',
+ action: 'decide_tip_amounts',
+ id: '1'
+ )
+ end
+
+ it 'routes GET /projects/1/tips to Tips#index' do
+ expect({ get: '/projects/1/tips' }).to route_to(
+ controller: 'tips',
+ action: 'index',
+ project_id: '1'
+ )
+ end
+
+ it 'routes GET /projects/1/deposits to Deposits#index' do
+ expect({ get: '/projects/1/deposits' }).to route_to(
+ controller: 'deposits',
+ action: 'index',
+ project_id: '1'
+ )
+ end
+
+ describe 'Project pretty url routing' do
+ it 'routes GET /:provider/:repo to Project#show' do
+ expect({ get: '/github/test/test' }).to route_to(
+ controller: 'projects',
+ action: 'show',
+ service: 'github',
+ repo: 'test/test'
+ )
+ end
+
+ it 'routes GET /:provider/:repo/edit to Project#edit' do
+ expect({ get: '/github/test/test/edit' }).to route_to(
+ controller: 'projects',
+ action: 'edit',
+ service: 'github',
+ repo: 'test/test'
+ )
+ end
+
+ it 'routes GET /:provider/:repo/decide_tip_amounts to Project#decide_tip_amounts' do
+ expect({ get: '/github/test/test/decide_tip_amounts' }).to route_to(
+ controller: 'projects',
+ action: 'decide_tip_amounts',
+ service: 'github',
+ repo: 'test/test'
+ )
+ end
+
+ it 'routes GET /:provider/:repo/tips to Project#tips' do
+ expect({ get: '/github/test/test/tips' }).to route_to(
+ controller: 'tips',
+ action: 'index',
+ service: 'github',
+ repo: 'test/test'
+ )
+ end
+
+ it 'routes GET /:provider/:repo/deposits to Project#deposits' do
+ expect({ get: '/github/test/test/deposits' }).to route_to(
+ controller: 'deposits',
+ action: 'index',
+ service: 'github',
+ repo: 'test/test'
+ )
+ end
+ end
+end
diff --git a/spec/routing/tips_routing_spec.rb b/spec/routing/tips_routing_spec.rb
new file mode 100644
index 00000000..23216754
--- /dev/null
+++ b/spec/routing/tips_routing_spec.rb
@@ -0,0 +1,12 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe 'routes for Tips', type: :routing do
+ it 'routes GET / to Tips#index' do
+ expect({ get: '/tips' }).to route_to(
+ controller: 'tips',
+ action: 'index'
+ )
+ end
+end
diff --git a/spec/routing/users_routing_spec.rb b/spec/routing/users_routing_spec.rb
new file mode 100644
index 00000000..2f8e6993
--- /dev/null
+++ b/spec/routing/users_routing_spec.rb
@@ -0,0 +1,67 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe 'routes for Users', type: :routing do
+ it 'routes GET /users to User#index' do
+ expect({ get: '/users' }).to route_to(
+ controller: 'users',
+ action: 'index'
+ )
+ end
+
+ it 'routes GET /users/nick-name321 to User#show' do
+ expect({ get: '/users/nick-name321' }).to route_to(
+ controller: 'users',
+ action: 'show',
+ nickname: 'nick-name321'
+ )
+ end
+
+ it 'routes GET /users/login to User#login' do
+ expect({ get: '/users/login' }).to route_to(
+ controller: 'users',
+ action: 'login'
+ )
+ end
+
+ it 'routes GET /users/1/tips to Tips#index' do
+ expect({ get: '/users/1/tips' }).to route_to(
+ controller: 'tips',
+ action: 'index',
+ user_id: '1'
+ )
+ end
+
+ describe 'pretty url routing' do
+ let(:user) { create(:user) }
+
+ it 'regex rejects reserved user paths' do
+ # accepted pertty url usernames
+ should_accept = [' ', 'logi', 'ogin', 's4c2', '42x', 'nick name', 'kd']
+ # reserved routes (rejected pertty url usernames)
+ should_reject = ['', '1', '42']
+
+ accepted = should_accept.select { |ea| ea =~ /\D+/ }
+ rejected = should_reject.select { |ea| (ea =~ /\D+/).nil? }
+ (expect(accepted.size).to eq(should_accept.size)) &&
+ (expect(rejected.size).to eq(should_reject.size))
+ end
+
+ it 'routes GET /users/:nickname to User#show' do
+ expect({ get: "/users/#{user.nickname}" }).to route_to(
+ controller: 'users',
+ action: 'show',
+ nickname: 'kd'
+ )
+ end
+
+ it 'routes GET /users/:nickname/tips to Tips#index' do
+ expect({ get: "/users/#{user.nickname}/tips" }).to route_to(
+ controller: 'tips',
+ action: 'index',
+ nickname: 'kd'
+ )
+ end
+ end
+end
diff --git a/spec/routing/withdrawals_routing_spec.rb b/spec/routing/withdrawals_routing_spec.rb
new file mode 100644
index 00000000..e64eac7f
--- /dev/null
+++ b/spec/routing/withdrawals_routing_spec.rb
@@ -0,0 +1,12 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe 'routes for Withdrawals', type: :routing do
+ it 'routes GET / to Withdrawals#index' do
+ expect({ get: '/withdrawals' }).to route_to(
+ controller: 'withdrawals',
+ action: 'index'
+ )
+ end
+end
From 5f462e488f3a230f05428a904f1c0d5ddd548dea Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Fri, 11 Dec 2020 09:33:36 +0100
Subject: [PATCH 092/159] added spec for users#destroy route
---
spec/routing/users_routing_spec.rb | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/spec/routing/users_routing_spec.rb b/spec/routing/users_routing_spec.rb
index 2f8e6993..3118aacd 100644
--- a/spec/routing/users_routing_spec.rb
+++ b/spec/routing/users_routing_spec.rb
@@ -33,6 +33,14 @@
)
end
+ it 'routes DELETE /users/1 to Tips#destroy' do
+ expect({ delete: '/users/1' }).to route_to(
+ controller: 'users',
+ action: 'destroy',
+ id: '1'
+ )
+ end
+
describe 'pretty url routing' do
let(:user) { create(:user) }
From 11552d2357bce8e8e7dc003ca8033bc06969a1f0 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Fri, 11 Dec 2020 10:22:16 +0100
Subject: [PATCH 093/159] reduced complexity
---
.rubocop_todo.yml | 6 +++---
app/controllers/projects_controller.rb | 20 ++++++++++++++++----
2 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 708ba3d1..ec0ccd09 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -1,12 +1,12 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
-# on 2020-12-06 18:08:51 UTC using RuboCop version 1.5.2.
+# on 2020-12-11 09:21:43 UTC using RuboCop version 1.5.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
-# Offense count: 16
+# Offense count: 15
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 34
@@ -27,7 +27,7 @@ Metrics/ClassLength:
Metrics/CyclomaticComplexity:
Max: 16
-# Offense count: 17
+# Offense count: 16
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
Metrics/MethodLength:
Max: 29
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index d6a6bde0..e789d7e7 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -49,8 +49,17 @@ def update
def decide_tip_amounts
authorize! :decide_tip_amounts, @project
return unless request.patch?
+ return unless validate_project_tips
@project.available_amount # preload anything required to get the amount, otherwise it's loaded during the assignation and there are undesirable consequences
+ return unless @project.update(permitted_project_tips_params)
+
+ tips_decided
+ end
+
+ private
+
+ def validate_project_tips
percentages = params[:project][:tips_attributes].values.map { |tip| tip['amount_percentage'].to_f }
if percentages.sum > 100
redirect_to decide_tip_amounts_project_path(@project), alert: I18n.t('errors.can_assign_more_tips')
@@ -58,9 +67,14 @@ def decide_tip_amounts
end
raise 'wrong data' if percentages.min.negative?
- @project.attributes = params.require(:project).permit(tips_attributes: %i[id amount_percentage])
- return unless @project.save
+ true
+ end
+
+ def permitted_project_tips_params
+ params.require(:project).permit(tips_attributes: %i[id amount_percentage])
+ end
+ def tips_decided
message = I18n.t('notices.tips_decided')
if @project.has_undecided_tips?
redirect_to decide_tip_amounts_project_path(@project), notice: message
@@ -69,8 +83,6 @@ def decide_tip_amounts
end
end
- private
-
def load_project
@project = if pretty_project_path?
Project.find_by_service_and_repo(params[:service], params[:repo])
From 84d005f510e743b96d4adb5961ef4483d59f8fbd Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Fri, 11 Dec 2020 10:24:13 +0100
Subject: [PATCH 094/159] updated rubocop
---
Gemfile.lock | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Gemfile.lock b/Gemfile.lock
index edbb4deb..60c53382 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -341,7 +341,7 @@ GEM
rspec-mocks (~> 3.9)
rspec-support (~> 3.9)
rspec-support (3.10.0)
- rubocop (1.5.2)
+ rubocop (1.6.1)
parallel (~> 1.10)
parser (>= 2.7.1.5)
rainbow (>= 2.2.2, < 4.0)
@@ -352,10 +352,10 @@ GEM
unicode-display_width (>= 1.4.0, < 2.0)
rubocop-ast (1.3.0)
parser (>= 2.7.1.5)
- rubocop-rails (2.8.1)
+ rubocop-rails (2.9.0)
activesupport (>= 4.2.0)
rack (>= 1.1)
- rubocop (>= 0.87.0)
+ rubocop (>= 0.90.0, < 2.0)
rubocop-rspec (2.0.1)
rubocop (~> 1.0)
rubocop-ast (>= 1.1.0)
From df7d2c971056818bc73c1cc71402a6fa7dbf016d Mon Sep 17 00:00:00 2001
From: kaue
Date: Sat, 6 Feb 2021 07:26:55 -0300
Subject: [PATCH 095/159] update license copyright year (#403)
---
LICENSE | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/LICENSE b/LICENSE
index 62c97553..ba6c1a51 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (c) 2018 tip4commit
+Copyright (c) 2021 tip4commit
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
From 65eaa7bf5788ea94186587de541ad1e4c5685eaf Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sun, 19 Mar 2023 15:09:07 +0100
Subject: [PATCH 096/159] Bump rack from 2.2.3 to 2.2.6.2 (#432)
Bumps [rack](https://github.com/rack/rack) from 2.2.3 to 2.2.6.2.
- [Release notes](https://github.com/rack/rack/releases)
- [Changelog](https://github.com/rack/rack/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rack/rack/compare/2.2.3...v2.2.6.2)
---
updated-dependencies:
- dependency-name: rack
dependency-type: indirect
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
Gemfile.lock | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Gemfile.lock b/Gemfile.lock
index 60c53382..fc792e43 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -266,7 +266,7 @@ GEM
parser (2.7.2.0)
ast (~> 2.4.1)
public_suffix (4.0.6)
- rack (2.2.3)
+ rack (2.2.6.2)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (5.2.4.4)
From 2bb7c4068f23ca9b307beabc19eec27f3ce5cfa6 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 19 Mar 2023 15:17:15 +0100
Subject: [PATCH 097/159] Replaced travis ci with github actions
---
.github/workflows/build.yml | 47 +++++++++++++++++++++++++++++++++++++
.travis.yml | 21 -----------------
README.md | 2 +-
3 files changed, 48 insertions(+), 22 deletions(-)
create mode 100644 .github/workflows/build.yml
delete mode 100644 .travis.yml
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 00000000..4b4bec84
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,47 @@
+name: Build
+
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ ruby-version: [2.6.6]
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v2
+
+ - name: Set up Ruby ${{ matrix.ruby-version }}
+ uses: ruby/setup-ruby@v1
+ with:
+ ruby-version: ${{ matrix.ruby-version }}
+ bundler-cache: true
+
+ - name: Install dependencies
+ run: |
+ bundle config path vendor/bundle
+ bundle install --jobs=9 --retry=2 --without development --quiet
+
+ - name: Setup database
+ run: |
+ cp config/config.yml.sample config/config.yml
+ cp config/database.yml.sample config/database.yml
+ bundle exec rake db:migrate
+
+ - name: Rubocop
+ run: |
+ bundle exec rubocop
+
+ - name: Run RSpec
+ run: |
+ bundle exec rake spec
+
+ - name: Run Cucumber
+ run: |
+ bundle exec rake cucumber
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 8e4b01eb..00000000
--- a/.travis.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-language: ruby
-
-sudo: false
-
-git:
- depth: 10
-
-rvm:
- - 2.6.6
-
-bundler_args: --without development --jobs=9 --retry=2 --quiet
-
-before_script:
- - cp config/config.yml.sample config/config.yml
- - cp config/database.yml.sample config/database.yml
-
-script:
- - bundle exec rubocop
- - bundle exec rake db:migrate
- - bundle exec rake spec
- - bundle exec rake cucumber
diff --git a/README.md b/README.md
index 3bfda6b4..a3d8ae80 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@ Tip4commit
==========
[](https://tip4commit.com/projects/307)
-[](https://travis-ci.org/tip4commit/tip4commit)
+[](https://github.com/tip4commit/tip4commit/actions)
Donate bitcoins to open source projects or receive tips for code contributions.
From a7443dbed9af1b4d994476f9298c3ca6f126dc8e Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 19 Mar 2023 15:45:14 +0100
Subject: [PATCH 098/159] Update ruby and rails to recover the build
---
.github/workflows/build.yml | 2 +-
.tool-versions | 1 +
Gemfile | 5 +-
Gemfile.lock | 158 +++++++++++++++++++-----------------
4 files changed, 89 insertions(+), 77 deletions(-)
create mode 100644 .tool-versions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 4b4bec84..4630c430 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
- ruby-version: [2.6.6]
+ ruby-version: [2.7.7]
steps:
- name: Checkout code
diff --git a/.tool-versions b/.tool-versions
new file mode 100644
index 00000000..33a8789f
--- /dev/null
+++ b/.tool-versions
@@ -0,0 +1 @@
+ruby 2.7.7
diff --git a/Gemfile b/Gemfile
index b7caddd2..c1483974 100644
--- a/Gemfile
+++ b/Gemfile
@@ -2,9 +2,9 @@
source 'https://rubygems.org'
-ruby '2.6.6'
+ruby '2.7.7'
-gem 'rails', '5.2.4.4'
+gem 'rails', '5.2.4.6'
gem 'acts_as_paranoid'
gem 'airbrake'
@@ -40,7 +40,6 @@ gem 'sawyer'
gem 'sdoc', group: :doc, require: false
gem 'sidekiq'
gem 'sprockets'
-gem 'therubyracer', platforms: :ruby
gem 'turbolinks'
gem 'twitter-bootstrap-rails'
gem 'uglifier'
diff --git a/Gemfile.lock b/Gemfile.lock
index fc792e43..7e150978 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,43 +1,43 @@
GEM
remote: https://rubygems.org/
specs:
- actioncable (5.2.4.4)
- actionpack (= 5.2.4.4)
+ actioncable (5.2.4.6)
+ actionpack (= 5.2.4.6)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
- actionmailer (5.2.4.4)
- actionpack (= 5.2.4.4)
- actionview (= 5.2.4.4)
- activejob (= 5.2.4.4)
+ actionmailer (5.2.4.6)
+ actionpack (= 5.2.4.6)
+ actionview (= 5.2.4.6)
+ activejob (= 5.2.4.6)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
- actionpack (5.2.4.4)
- actionview (= 5.2.4.4)
- activesupport (= 5.2.4.4)
+ actionpack (5.2.4.6)
+ actionview (= 5.2.4.6)
+ activesupport (= 5.2.4.6)
rack (~> 2.0, >= 2.0.8)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
- actionview (5.2.4.4)
- activesupport (= 5.2.4.4)
+ actionview (5.2.4.6)
+ activesupport (= 5.2.4.6)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
- activejob (5.2.4.4)
- activesupport (= 5.2.4.4)
+ activejob (5.2.4.6)
+ activesupport (= 5.2.4.6)
globalid (>= 0.3.6)
- activemodel (5.2.4.4)
- activesupport (= 5.2.4.4)
- activerecord (5.2.4.4)
- activemodel (= 5.2.4.4)
- activesupport (= 5.2.4.4)
+ activemodel (5.2.4.6)
+ activesupport (= 5.2.4.6)
+ activerecord (5.2.4.6)
+ activemodel (= 5.2.4.6)
+ activesupport (= 5.2.4.6)
arel (>= 9.0)
- activestorage (5.2.4.4)
- actionpack (= 5.2.4.4)
- activerecord (= 5.2.4.4)
+ activestorage (5.2.4.6)
+ actionpack (= 5.2.4.6)
+ activerecord (= 5.2.4.6)
marcel (~> 0.3.1)
- activesupport (5.2.4.4)
+ activesupport (5.2.4.6)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
@@ -93,7 +93,7 @@ GEM
execjs
coffee-script-source (1.12.2)
commonjs (0.2.7)
- concurrent-ruby (1.1.7)
+ concurrent-ruby (1.2.2)
connection_pool (2.2.3)
crack (0.4.4)
crass (1.0.6)
@@ -120,6 +120,7 @@ GEM
cucumber-tag_expressions (1.1.1)
cucumber-wire (0.0.1)
database_cleaner (1.8.5)
+ date (3.3.3)
demoji (0.0.7)
devise (4.7.3)
bcrypt (~> 3.0)
@@ -140,7 +141,7 @@ GEM
ed25519 (1.2.4)
edge_rider (1.1.0)
activerecord (>= 3.2)
- erubi (1.10.0)
+ erubi (1.12.0)
erubis (2.7.0)
execjs (2.7.0)
factory_bot (6.1.0)
@@ -153,8 +154,8 @@ GEM
ruby2_keywords
ffi (1.13.1)
gherkin (5.1.0)
- globalid (0.4.2)
- activesupport (>= 4.2.0)
+ globalid (1.1.0)
+ activesupport (>= 5.0)
haml (5.2.1)
temple (>= 0.8.0)
tilt
@@ -175,7 +176,7 @@ GEM
http-cookie (1.0.3)
domain_name (~> 0.5)
http_accept_language (2.1.1)
- i18n (1.8.5)
+ i18n (1.12.0)
concurrent-ruby (~> 1.0)
i18n-js (3.8.0)
i18n (>= 0.6.6)
@@ -210,36 +211,50 @@ GEM
actionpack (>= 4)
less (~> 2.6.0)
sprockets (>= 2)
- libv8 (3.16.14.19)
- loofah (2.8.0)
+ loofah (2.19.1)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
- mail (2.7.1)
+ mail (2.8.1)
mini_mime (>= 0.1.1)
+ net-imap
+ net-pop
+ net-smtp
marcel (0.3.3)
mimemagic (~> 0.3.2)
method_source (1.0.0)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2020.1104)
- mimemagic (0.3.5)
- mini_mime (1.0.2)
- mini_portile2 (2.4.0)
- minitest (5.14.2)
+ mimemagic (0.3.10)
+ nokogiri (~> 1)
+ rake
+ mini_mime (1.1.2)
+ mini_portile2 (2.8.1)
+ minitest (5.18.0)
money-tree (0.10.0)
ffi
multi_json (1.15.0)
multi_test (0.1.2)
multi_xml (0.6.0)
multipart-post (2.1.1)
- mysql2 (0.5.3)
+ mysql2 (0.5.5)
+ net-imap (0.3.4)
+ date
+ net-protocol
+ net-pop (0.1.2)
+ net-protocol
+ net-protocol (0.2.1)
+ timeout
net-scp (3.0.0)
net-ssh (>= 2.6.5, < 7.0.0)
+ net-smtp (0.3.3)
+ net-protocol
net-ssh (6.1.0)
netrc (0.11.0)
- nio4r (2.5.4)
- nokogiri (1.10.10)
- mini_portile2 (~> 2.4.0)
+ nio4r (2.5.8)
+ nokogiri (1.14.2)
+ mini_portile2 (~> 2.8.0)
+ racc (~> 1.4)
oauth2 (1.4.4)
faraday (>= 0.8, < 2.0)
jwt (>= 1.0, < 3.0)
@@ -266,21 +281,22 @@ GEM
parser (2.7.2.0)
ast (~> 2.4.1)
public_suffix (4.0.6)
- rack (2.2.6.2)
- rack-test (1.1.0)
- rack (>= 1.0, < 3)
- rails (5.2.4.4)
- actioncable (= 5.2.4.4)
- actionmailer (= 5.2.4.4)
- actionpack (= 5.2.4.4)
- actionview (= 5.2.4.4)
- activejob (= 5.2.4.4)
- activemodel (= 5.2.4.4)
- activerecord (= 5.2.4.4)
- activestorage (= 5.2.4.4)
- activesupport (= 5.2.4.4)
+ racc (1.6.2)
+ rack (2.2.6.4)
+ rack-test (2.1.0)
+ rack (>= 1.3)
+ rails (5.2.4.6)
+ actioncable (= 5.2.4.6)
+ actionmailer (= 5.2.4.6)
+ actionpack (= 5.2.4.6)
+ actionview (= 5.2.4.6)
+ activejob (= 5.2.4.6)
+ activemodel (= 5.2.4.6)
+ activerecord (= 5.2.4.6)
+ activestorage (= 5.2.4.6)
+ activesupport (= 5.2.4.6)
bundler (>= 1.3.0)
- railties (= 5.2.4.4)
+ railties (= 5.2.4.6)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
@@ -289,25 +305,24 @@ GEM
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
- rails-html-sanitizer (1.3.0)
- loofah (~> 2.3)
+ rails-html-sanitizer (1.5.0)
+ loofah (~> 2.19, >= 2.19.1)
rails-i18n (5.1.3)
i18n (>= 0.7, < 2)
railties (>= 5.0, < 6)
- railties (5.2.4.4)
- actionpack (= 5.2.4.4)
- activesupport (= 5.2.4.4)
+ railties (5.2.4.6)
+ actionpack (= 5.2.4.6)
+ activesupport (= 5.2.4.6)
method_source
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
rainbow (3.0.0)
- rake (13.0.1)
+ rake (13.0.6)
rbnacl (7.1.1)
ffi
rbtree3 (0.6.0)
rdoc (6.2.1)
redis (4.2.5)
- ref (2.0.0)
regexp_parser (1.8.2)
render_csv (2.0.0)
rails (>= 3.0)
@@ -391,24 +406,22 @@ GEM
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.2)
- sprockets (4.0.2)
+ sprockets (4.2.0)
concurrent-ruby (~> 1.0)
- rack (> 1, < 3)
- sprockets-rails (3.2.2)
- actionpack (>= 4.0)
- activesupport (>= 4.0)
+ rack (>= 2.2.4, < 4)
+ sprockets-rails (3.4.2)
+ actionpack (>= 5.2)
+ activesupport (>= 5.2)
sprockets (>= 3.0.0)
sqlite3 (1.4.2)
sshkit (1.21.1)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
temple (0.8.2)
- therubyracer (0.12.3)
- libv8 (~> 3.16.14.15)
- ref
- thor (1.0.1)
+ thor (1.2.1)
thread_safe (0.3.6)
tilt (2.0.10)
+ timeout (0.3.2)
turbolinks (5.2.1)
turbolinks-source (~> 5.2)
turbolinks-source (5.2.0)
@@ -417,7 +430,7 @@ GEM
execjs (>= 2.2.2, >= 2.2)
less-rails (>= 2.5.0)
railties (>= 3.1)
- tzinfo (1.2.8)
+ tzinfo (1.2.11)
thread_safe (~> 0.1)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
@@ -432,7 +445,7 @@ GEM
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
- websocket-driver (0.7.3)
+ websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
xpath (3.2.0)
@@ -477,7 +490,7 @@ DEPENDENCIES
omniauth
omniauth-github
omniauth-rails_csrf_protection (~> 0.1)
- rails (= 5.2.4.4)
+ rails (= 5.2.4.6)
rails-controller-testing
rails-i18n
rbnacl
@@ -496,7 +509,6 @@ DEPENDENCIES
simplecov
sprockets
sqlite3
- therubyracer
turbolinks
twitter-bootstrap-rails
uglifier
@@ -504,7 +516,7 @@ DEPENDENCIES
webmock
RUBY VERSION
- ruby 2.6.6p146
+ ruby 2.7.7p221
BUNDLED WITH
2.1.4
From 39c4d62676fda86f4e63aaa8d25f55bc30fb8931 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 19 Mar 2023 15:54:18 +0100
Subject: [PATCH 099/159] updated rubocop.yml
---
.rubocop.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.rubocop.yml b/.rubocop.yml
index 994cd4c0..bb57d5e0 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -6,7 +6,7 @@ require:
- rubocop-rspec
AllCops:
- TargetRubyVersion: 2.6
+ TargetRubyVersion: 2.7
NewCops: enable
Exclude:
- 'db/schema.rb'
From 6178881046ae24f6aebbe8a2f1e579cbf44e241d Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 19 Mar 2023 15:59:53 +0100
Subject: [PATCH 100/159] udpated rubocop
---
Gemfile.lock | 30 ++++++++++++++++--------------
1 file changed, 16 insertions(+), 14 deletions(-)
diff --git a/Gemfile.lock b/Gemfile.lock
index 7e150978..0fd082be 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -54,7 +54,7 @@ GEM
airbrussh (1.4.0)
sshkit (>= 1.6.1, != 1.7.0)
arel (9.0.0)
- ast (2.4.1)
+ ast (2.4.2)
backports (3.18.2)
bcrypt (3.1.16)
bcrypt_pbkdf (1.0.1)
@@ -189,6 +189,7 @@ GEM
jquery-turbolinks (2.1.0)
railties (>= 3.1.0)
turbolinks
+ json (2.6.3)
jwt (2.2.2)
kaminari (1.2.1)
activesupport (>= 4.1.0)
@@ -277,8 +278,8 @@ GEM
actionpack (>= 4.2)
omniauth (>= 1.3.1)
orm_adapter (0.5.0)
- parallel (1.20.1)
- parser (2.7.2.0)
+ parallel (1.22.1)
+ parser (3.2.1.1)
ast (~> 2.4.1)
public_suffix (4.0.6)
racc (1.6.2)
@@ -316,7 +317,7 @@ GEM
method_source
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
- rainbow (3.0.0)
+ rainbow (3.1.1)
rake (13.0.6)
rbnacl (7.1.1)
ffi
@@ -334,7 +335,7 @@ GEM
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
- rexml (3.2.4)
+ rexml (3.2.5)
rspec-activemodel-mocks (1.1.0)
activemodel (>= 3.0)
activesupport (>= 3.0)
@@ -356,17 +357,18 @@ GEM
rspec-mocks (~> 3.9)
rspec-support (~> 3.9)
rspec-support (3.10.0)
- rubocop (1.6.1)
+ rubocop (1.48.1)
+ json (~> 2.3)
parallel (~> 1.10)
- parser (>= 2.7.1.5)
+ parser (>= 3.2.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
- rexml
- rubocop-ast (>= 1.2.0, < 2.0)
+ rexml (>= 3.2.5, < 4.0)
+ rubocop-ast (>= 1.26.0, < 2.0)
ruby-progressbar (~> 1.7)
- unicode-display_width (>= 1.4.0, < 2.0)
- rubocop-ast (1.3.0)
- parser (>= 2.7.1.5)
+ unicode-display_width (>= 2.4.0, < 3.0)
+ rubocop-ast (1.27.0)
+ parser (>= 3.2.1.0)
rubocop-rails (2.9.0)
activesupport (>= 4.2.0)
rack (>= 1.1)
@@ -374,7 +376,7 @@ GEM
rubocop-rspec (2.0.1)
rubocop (~> 1.0)
rubocop-ast (>= 1.1.0)
- ruby-progressbar (1.10.1)
+ ruby-progressbar (1.13.0)
ruby2_keywords (0.0.2)
ruby_parser (3.15.0)
sexp_processor (~> 4.9)
@@ -437,7 +439,7 @@ GEM
unf (0.1.4)
unf_ext
unf_ext (0.0.7.7)
- unicode-display_width (1.7.0)
+ unicode-display_width (2.4.2)
vcr (6.0.0)
warden (1.2.9)
rack (>= 2.0.9)
From fb952ea156e874b1af2cac3407f0b8fafc1a7bfa Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 19 Mar 2023 16:12:29 +0100
Subject: [PATCH 101/159] updated rubocop todo file
---
.rubocop_todo.yml | 101 +++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 92 insertions(+), 9 deletions(-)
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index ec0ccd09..97cc3a0e 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -1,19 +1,46 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
-# on 2020-12-11 09:21:43 UTC using RuboCop version 1.5.2.
+# on 2023-03-19 15:11:29 UTC using RuboCop version 1.48.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
+# Offense count: 1
+# This cop supports safe autocorrection (--autocorrect).
+# Configuration parameters: EnforcedStyle, IndentationWidth.
+# SupportedStyles: aligned, indented
+Layout/LineEndStringConcatenationIndentation:
+ Exclude:
+ - 'spec/factories/wallets.rb'
+
+# Offense count: 1
+# This cop supports safe autocorrection (--autocorrect).
+Lint/AmbiguousOperatorPrecedence:
+ Exclude:
+ - 'lib/bitcoin_address_validator.rb'
+
+# Offense count: 1
+# This cop supports safe autocorrection (--autocorrect).
+Lint/ElseLayout:
+ Exclude:
+ - 'features/step_definitions/common.rb'
+
+# Offense count: 2
+# This cop supports unsafe autocorrection (--autocorrect-all).
+Lint/OrAssignmentToConstant:
+ Exclude:
+ - 'config/application.rb'
+ - 'config/initializers/blacklist.rb'
+
# Offense count: 15
-# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
+# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 34
# Offense count: 15
-# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
-# IgnoredMethods: refine
+# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
+# AllowedMethods: refine
Metrics/BlockLength:
Max: 117
@@ -23,17 +50,17 @@ Metrics/ClassLength:
Max: 187
# Offense count: 2
-# Configuration parameters: IgnoredMethods.
+# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/CyclomaticComplexity:
Max: 16
# Offense count: 16
-# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
+# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
Metrics/MethodLength:
Max: 29
# Offense count: 2
-# Configuration parameters: IgnoredMethods.
+# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/PerceivedComplexity:
Max: 13
@@ -131,14 +158,70 @@ Rails/SkipsModelValidations:
- 'db/migrate/20140402082149_add_fee_size_to_deposits.rb'
- 'lib/bitcoin_tipper.rb'
+# Offense count: 2
+# This cop supports safe autocorrection (--autocorrect).
+# Configuration parameters: AllowOnlyRestArgument.
+Style/ArgumentsForwarding:
+ Exclude:
+ - 'features/support/ostruct_slice.rb'
+
+# Offense count: 1
+# This cop supports safe autocorrection (--autocorrect).
+# Configuration parameters: AllowSplatArgument.
+Style/HashConversion:
+ Exclude:
+ - 'app/models/project.rb'
+
# Offense count: 1
Style/MissingRespondToMissing:
Exclude:
- 'lib/bitcoin_rpc.rb'
+# Offense count: 1
+Style/OpenStructUse:
+ Exclude:
+ - 'features/support/to_ostruct.rb'
+
+# Offense count: 5
+# This cop supports safe autocorrection (--autocorrect).
+Style/RedundantConstantBase:
+ Exclude:
+ - 'config.ru'
+ - 'config/environments/production.rb'
+ - 'lib/tasks/cucumber.rake'
+ - 'spec/spec_helper.rb'
+
+# Offense count: 2
+# This cop supports safe autocorrection (--autocorrect).
+Style/RedundantRegexpEscape:
+ Exclude:
+ - 'config/routes.rb'
+
+# Offense count: 1
+# This cop supports unsafe autocorrection (--autocorrect-all).
+Style/SelectByRegexp:
+ Exclude:
+ - 'spec/routing/users_routing_spec.rb'
+
+# Offense count: 1
+# This cop supports unsafe autocorrection (--autocorrect-all).
+# Configuration parameters: AllowMethodsWithArguments, AllowedMethods, AllowedPatterns, AllowComments.
+# AllowedMethods: define_method
+Style/SymbolProc:
+ Exclude:
+ - 'app/controllers/home_controller.rb'
+
+# Offense count: 1
+# This cop supports safe autocorrection (--autocorrect).
+# Configuration parameters: EnforcedStyle, MinSize, WordRegex.
+# SupportedStyles: percent, brackets
+Style/WordArray:
+ Exclude:
+ - 'lib/tasks/cucumber.rake'
+
# Offense count: 25
-# Cop supports --auto-correct.
-# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
+# This cop supports safe autocorrection (--autocorrect).
+# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
# URISchemes: http, https
Layout/LineLength:
Max: 234
From 05e6ec04edcbf733aacdf29f77cf90e87c780bad Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 19 Mar 2023 16:22:25 +0100
Subject: [PATCH 102/159] show rubocop version in ci
---
.github/workflows/build.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 4630c430..4db79244 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -36,6 +36,7 @@ jobs:
- name: Rubocop
run: |
+ bundle exec rubocop --version
bundle exec rubocop
- name: Run RSpec
From b58484dfc6a8427e3d0d1c48193aab02b043faf6 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 19 Mar 2023 16:31:16 +0100
Subject: [PATCH 103/159] updated rubocop dependencies
---
.rubocop_todo.yml | 105 +++++++++++++++++++++++++++++++++++++---------
Gemfile.lock | 12 +++---
2 files changed, 93 insertions(+), 24 deletions(-)
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 97cc3a0e..cff5c871 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
-# on 2023-03-19 15:11:29 UTC using RuboCop version 1.48.1.
+# on 2023-03-19 15:30:48 UTC using RuboCop version 1.48.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
@@ -38,11 +38,11 @@ Lint/OrAssignmentToConstant:
Metrics/AbcSize:
Max: 34
-# Offense count: 15
-# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
+# Offense count: 1
+# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
# AllowedMethods: refine
Metrics/BlockLength:
- Max: 117
+ Max: 29
# Offense count: 2
# Configuration parameters: CountComments, CountAsOne.
@@ -74,22 +74,38 @@ Naming/PredicateName:
Exclude:
- 'app/models/project.rb'
+# Offense count: 9
+# This cop supports unsafe autocorrection (--autocorrect-all).
+RSpec/BeEq:
+ Exclude:
+ - 'spec/lib/blacklist_spec.rb'
+
# Offense count: 1
-# Configuration parameters: Prefixes.
+# Configuration parameters: Prefixes, AllowedPatterns.
# Prefixes: when, with, without
RSpec/ContextWording:
Exclude:
- 'spec/controllers/projects_controller_spec.rb'
# Offense count: 13
-# Configuration parameters: Max.
+# Configuration parameters: CountAsOne.
RSpec/ExampleLength:
+ Max: 16
+
+# Offense count: 1
+# This cop supports safe autocorrection (--autocorrect).
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: require_parentheses, omit_parentheses
+RSpec/FactoryBot/ConsistentParenthesesStyle:
Exclude:
- 'spec/controllers/projects_controller_spec.rb'
- - 'spec/lib/blacklist_spec.rb'
- - 'spec/models/deposit_spec.rb'
- - 'spec/routing/projects_routing_spec.rb'
- - 'spec/routing/users_routing_spec.rb'
+
+# Offense count: 1
+# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
+# Include: **/*_spec*rb*, **/spec/**/*
+RSpec/FilePath:
+ Exclude:
+ - 'spec/features/assets.rb'
# Offense count: 2
# Configuration parameters: AssignmentOnly.
@@ -109,7 +125,8 @@ RSpec/MultipleExpectations:
Max: 9
# Offense count: 26
-# Configuration parameters: IgnoreSharedExamples.
+# Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
+# SupportedStyles: always, named_only
RSpec/NamedSubject:
Exclude:
- 'spec/controllers/home_controller_spec.rb'
@@ -118,9 +135,16 @@ RSpec/NamedSubject:
- 'spec/models/wallet_spec.rb'
# Offense count: 4
+# Configuration parameters: AllowedGroups.
RSpec/NestedGroups:
Max: 5
+# Offense count: 22
+# This cop supports unsafe autocorrection (--autocorrect-all).
+# Configuration parameters: Inferences.
+RSpec/Rails/InferredSpecType:
+ Enabled: false
+
# Offense count: 2
RSpec/RepeatedExampleGroupBody:
Exclude:
@@ -131,6 +155,50 @@ RSpec/StubbedMock:
Exclude:
- 'spec/controllers/projects_controller_spec.rb'
+# Offense count: 8
+RSpec/SubjectDeclaration:
+ Exclude:
+ - 'spec/controllers/home_controller_spec.rb'
+ - 'spec/controllers/projects_controller_spec.rb'
+ - 'spec/controllers/users_controller_spec.rb'
+
+# Offense count: 1
+# This cop supports safe autocorrection (--autocorrect).
+# Configuration parameters: ExpectedOrder, Include.
+# ExpectedOrder: index, show, new, edit, create, update, destroy
+# Include: app/controllers/**/*.rb
+Rails/ActionOrder:
+ Exclude:
+ - 'app/controllers/users_controller.rb'
+
+# Offense count: 1
+# This cop supports unsafe autocorrection (--autocorrect-all).
+Rails/ActiveSupportOnLoad:
+ Exclude:
+ - 'config/initializers/demoji.rb'
+
+# Offense count: 1
+# This cop supports safe autocorrection (--autocorrect).
+# Configuration parameters: Include.
+# Include: db/migrate/*.rb
+Rails/AddColumnIndex:
+ Exclude:
+ - 'db/migrate/20151219081507_add_bitcoin_address2_to_projects.rb'
+
+# Offense count: 1
+# This cop supports unsafe autocorrection (--autocorrect-all).
+# Configuration parameters: Severity.
+Rails/DeprecatedActiveModelErrorsMethods:
+ Exclude:
+ - 'lib/bitcoin_address_validator.rb'
+
+# Offense count: 1
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: slashes, arguments
+Rails/FilePath:
+ Exclude:
+ - 'spec/spec_helper.rb'
+
# Offense count: 6
# Configuration parameters: Include.
# Include: app/models/**/*.rb
@@ -146,6 +214,13 @@ Rails/OutputSafety:
- 'app/helpers/application_helper.rb'
- 'app/helpers/rates_helper.rb'
+# Offense count: 1
+# Configuration parameters: Include.
+# Include: db/**/*.rb
+Rails/ReversibleMigration:
+ Exclude:
+ - 'db/migrate/20140823060921_make_default_branch_blank.rb'
+
# Offense count: 11
# Configuration parameters: ForbiddenMethods, AllowedMethods.
# ForbiddenMethods: decrement!, decrement_counter, increment!, increment_counter, insert, insert!, insert_all, insert_all!, toggle!, touch, touch_all, update_all, update_attribute, update_column, update_columns, update_counters, upsert, upsert_all
@@ -203,14 +278,6 @@ Style/SelectByRegexp:
Exclude:
- 'spec/routing/users_routing_spec.rb'
-# Offense count: 1
-# This cop supports unsafe autocorrection (--autocorrect-all).
-# Configuration parameters: AllowMethodsWithArguments, AllowedMethods, AllowedPatterns, AllowComments.
-# AllowedMethods: define_method
-Style/SymbolProc:
- Exclude:
- - 'app/controllers/home_controller.rb'
-
# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, MinSize, WordRegex.
diff --git a/Gemfile.lock b/Gemfile.lock
index 0fd082be..ea66a503 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -369,13 +369,15 @@ GEM
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.27.0)
parser (>= 3.2.1.0)
- rubocop-rails (2.9.0)
+ rubocop-capybara (2.17.1)
+ rubocop (~> 1.41)
+ rubocop-rails (2.18.0)
activesupport (>= 4.2.0)
rack (>= 1.1)
- rubocop (>= 0.90.0, < 2.0)
- rubocop-rspec (2.0.1)
- rubocop (~> 1.0)
- rubocop-ast (>= 1.1.0)
+ rubocop (>= 1.33.0, < 2.0)
+ rubocop-rspec (2.19.0)
+ rubocop (~> 1.33)
+ rubocop-capybara (~> 2.17)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.2)
ruby_parser (3.15.0)
From 229103d62ff850fdc738d1a8e5a1c81c6191287d Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 19 Mar 2023 20:19:39 +0100
Subject: [PATCH 104/159] rubocop: ignore vendored files
---
.rubocop.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/.rubocop.yml b/.rubocop.yml
index bb57d5e0..9352092f 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -11,6 +11,7 @@ AllCops:
Exclude:
- 'db/schema.rb'
- 'bin/*'
+ - 'vendor/**/*'
Style/Documentation:
Enabled: false
From 739db6533dd4027364f34ce7b454c3205cc2f383 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 19 Mar 2023 20:26:11 +0100
Subject: [PATCH 105/159] fixed migrations in ci
---
.github/workflows/build.yml | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 4db79244..5ac2490e 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -28,15 +28,14 @@ jobs:
bundle config path vendor/bundle
bundle install --jobs=9 --retry=2 --without development --quiet
- - name: Setup database
+ - name: Setup test database
run: |
cp config/config.yml.sample config/config.yml
cp config/database.yml.sample config/database.yml
- bundle exec rake db:migrate
+ bin/rails db:migrate RAILS_ENV=test
- name: Rubocop
run: |
- bundle exec rubocop --version
bundle exec rubocop
- name: Run RSpec
From d8a9cf7b8c681547e59c1580a32dbebd68ca4be2 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 19 Mar 2023 20:33:15 +0100
Subject: [PATCH 106/159] removed sidekiq as it is not used
---
Gemfile | 1 -
Gemfile.lock | 7 -------
config/application.rb | 1 -
3 files changed, 9 deletions(-)
diff --git a/Gemfile b/Gemfile
index c1483974..fa503a1f 100644
--- a/Gemfile
+++ b/Gemfile
@@ -38,7 +38,6 @@ gem 'rest-client'
gem 'sass-rails'
gem 'sawyer'
gem 'sdoc', group: :doc, require: false
-gem 'sidekiq'
gem 'sprockets'
gem 'turbolinks'
gem 'twitter-bootstrap-rails'
diff --git a/Gemfile.lock b/Gemfile.lock
index ea66a503..36cd4140 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -94,7 +94,6 @@ GEM
coffee-script-source (1.12.2)
commonjs (0.2.7)
concurrent-ruby (1.2.2)
- connection_pool (2.2.3)
crack (0.4.4)
crass (1.0.6)
cucumber (3.2.0)
@@ -323,7 +322,6 @@ GEM
ffi
rbtree3 (0.6.0)
rdoc (6.2.1)
- redis (4.2.5)
regexp_parser (1.8.2)
render_csv (2.0.0)
rails (>= 3.0)
@@ -400,10 +398,6 @@ GEM
sexp_processor (4.15.1)
shoulda-matchers (4.4.1)
activesupport (>= 4.2.0)
- sidekiq (6.1.2)
- connection_pool (>= 2.2.2)
- rack (~> 2.0)
- redis (>= 4.2.0)
simplecov (0.20.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
@@ -509,7 +503,6 @@ DEPENDENCIES
sawyer
sdoc
shoulda-matchers
- sidekiq
simplecov
sprockets
sqlite3
diff --git a/config/application.rb b/config/application.rb
index e2412382..f4b595d1 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -28,7 +28,6 @@ class Application < Rails::Application
config.autoload_paths += %W[#{config.root}/lib]
config.assets.initialize_on_precompile = true
config.available_locales = %w[en es fr nl ru pl hr de ro ko id ja pt my cn hk]
- config.active_job.queue_adapter = :sidekiq
config.active_record.sqlite3.represent_boolean_as_integer = true
end
end
From 587e332793dd55fa65ad56c4df4d09e3d7a1884b Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 19 Mar 2023 20:38:50 +0100
Subject: [PATCH 107/159] updated rails
---
Gemfile | 2 +-
Gemfile.lock | 82 +++++++++++++++++++++++++---------------------------
2 files changed, 40 insertions(+), 44 deletions(-)
diff --git a/Gemfile b/Gemfile
index fa503a1f..76ea9445 100644
--- a/Gemfile
+++ b/Gemfile
@@ -4,7 +4,7 @@ source 'https://rubygems.org'
ruby '2.7.7'
-gem 'rails', '5.2.4.6'
+gem 'rails', '5.2.8.1'
gem 'acts_as_paranoid'
gem 'airbrake'
diff --git a/Gemfile.lock b/Gemfile.lock
index 36cd4140..1a540441 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,43 +1,43 @@
GEM
remote: https://rubygems.org/
specs:
- actioncable (5.2.4.6)
- actionpack (= 5.2.4.6)
+ actioncable (5.2.8.1)
+ actionpack (= 5.2.8.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
- actionmailer (5.2.4.6)
- actionpack (= 5.2.4.6)
- actionview (= 5.2.4.6)
- activejob (= 5.2.4.6)
+ actionmailer (5.2.8.1)
+ actionpack (= 5.2.8.1)
+ actionview (= 5.2.8.1)
+ activejob (= 5.2.8.1)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
- actionpack (5.2.4.6)
- actionview (= 5.2.4.6)
- activesupport (= 5.2.4.6)
+ actionpack (5.2.8.1)
+ actionview (= 5.2.8.1)
+ activesupport (= 5.2.8.1)
rack (~> 2.0, >= 2.0.8)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
- actionview (5.2.4.6)
- activesupport (= 5.2.4.6)
+ actionview (5.2.8.1)
+ activesupport (= 5.2.8.1)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
- activejob (5.2.4.6)
- activesupport (= 5.2.4.6)
+ activejob (5.2.8.1)
+ activesupport (= 5.2.8.1)
globalid (>= 0.3.6)
- activemodel (5.2.4.6)
- activesupport (= 5.2.4.6)
- activerecord (5.2.4.6)
- activemodel (= 5.2.4.6)
- activesupport (= 5.2.4.6)
+ activemodel (5.2.8.1)
+ activesupport (= 5.2.8.1)
+ activerecord (5.2.8.1)
+ activemodel (= 5.2.8.1)
+ activesupport (= 5.2.8.1)
arel (>= 9.0)
- activestorage (5.2.4.6)
- actionpack (= 5.2.4.6)
- activerecord (= 5.2.4.6)
- marcel (~> 0.3.1)
- activesupport (5.2.4.6)
+ activestorage (5.2.8.1)
+ actionpack (= 5.2.8.1)
+ activerecord (= 5.2.8.1)
+ marcel (~> 1.0.0)
+ activesupport (5.2.8.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
@@ -219,15 +219,11 @@ GEM
net-imap
net-pop
net-smtp
- marcel (0.3.3)
- mimemagic (~> 0.3.2)
+ marcel (1.0.2)
method_source (1.0.0)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2020.1104)
- mimemagic (0.3.10)
- nokogiri (~> 1)
- rake
mini_mime (1.1.2)
mini_portile2 (2.8.1)
minitest (5.18.0)
@@ -285,18 +281,18 @@ GEM
rack (2.2.6.4)
rack-test (2.1.0)
rack (>= 1.3)
- rails (5.2.4.6)
- actioncable (= 5.2.4.6)
- actionmailer (= 5.2.4.6)
- actionpack (= 5.2.4.6)
- actionview (= 5.2.4.6)
- activejob (= 5.2.4.6)
- activemodel (= 5.2.4.6)
- activerecord (= 5.2.4.6)
- activestorage (= 5.2.4.6)
- activesupport (= 5.2.4.6)
+ rails (5.2.8.1)
+ actioncable (= 5.2.8.1)
+ actionmailer (= 5.2.8.1)
+ actionpack (= 5.2.8.1)
+ actionview (= 5.2.8.1)
+ activejob (= 5.2.8.1)
+ activemodel (= 5.2.8.1)
+ activerecord (= 5.2.8.1)
+ activestorage (= 5.2.8.1)
+ activesupport (= 5.2.8.1)
bundler (>= 1.3.0)
- railties (= 5.2.4.6)
+ railties (= 5.2.8.1)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
@@ -310,9 +306,9 @@ GEM
rails-i18n (5.1.3)
i18n (>= 0.7, < 2)
railties (>= 5.0, < 6)
- railties (5.2.4.6)
- actionpack (= 5.2.4.6)
- activesupport (= 5.2.4.6)
+ railties (5.2.8.1)
+ actionpack (= 5.2.8.1)
+ activesupport (= 5.2.8.1)
method_source
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
@@ -488,7 +484,7 @@ DEPENDENCIES
omniauth
omniauth-github
omniauth-rails_csrf_protection (~> 0.1)
- rails (= 5.2.4.6)
+ rails (= 5.2.8.1)
rails-controller-testing
rails-i18n
rbnacl
From 6204753626569f7273901ac8082546f727b42810 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 19 Mar 2023 20:46:15 +0100
Subject: [PATCH 108/159] test with several ruby versions
---
.github/workflows/build.yml | 5 +++--
Gemfile | 2 --
Gemfile.lock | 3 ---
LICENSE | 2 +-
4 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 5ac2490e..54df9b37 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
- ruby-version: [2.7.7]
+ ruby-version: [2.7.7 3.0.5 3.1.3]
steps:
- name: Checkout code
@@ -25,8 +25,9 @@ jobs:
- name: Install dependencies
run: |
+ bundle config set without 'development'
bundle config path vendor/bundle
- bundle install --jobs=9 --retry=2 --without development --quiet
+ bundle install --jobs=9 --retry=2 --quiet
- name: Setup test database
run: |
diff --git a/Gemfile b/Gemfile
index 76ea9445..5f2006d5 100644
--- a/Gemfile
+++ b/Gemfile
@@ -2,8 +2,6 @@
source 'https://rubygems.org'
-ruby '2.7.7'
-
gem 'rails', '5.2.8.1'
gem 'acts_as_paranoid'
diff --git a/Gemfile.lock b/Gemfile.lock
index 1a540441..2d0e65e9 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -508,8 +508,5 @@ DEPENDENCIES
vcr
webmock
-RUBY VERSION
- ruby 2.7.7p221
-
BUNDLED WITH
2.1.4
diff --git a/LICENSE b/LICENSE
index ba6c1a51..b3246315 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (c) 2021 tip4commit
+Copyright (c) 2023 tip4commit
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
From 14f988aae266581d6d47241bce6f4140ee34575d Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 19 Mar 2023 20:47:30 +0100
Subject: [PATCH 109/159] fixed ci
---
.github/workflows/build.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 54df9b37..f457853f 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
- ruby-version: [2.7.7 3.0.5 3.1.3]
+ ruby-version: [2.7.7, 3.0.5, 3.1.3]
steps:
- name: Checkout code
From 4437d696aa43dd849fd196ca53abe70bae304816 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 19 Mar 2023 20:48:56 +0100
Subject: [PATCH 110/159] removed ruby 3.1.3
---
.github/workflows/build.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index f457853f..b8b47f73 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
- ruby-version: [2.7.7, 3.0.5, 3.1.3]
+ ruby-version: [2.7.7, 3.0.5]
steps:
- name: Checkout code
From 2edf8b34530d84dfcb35dd9e88bc173d1ccc9e1a Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 19 Mar 2023 20:52:00 +0100
Subject: [PATCH 111/159] ci: set fail-fast to false
---
.github/workflows/build.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index b8b47f73..13a8963c 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -12,6 +12,7 @@ jobs:
strategy:
matrix:
ruby-version: [2.7.7, 3.0.5]
+ fail-fast: false
steps:
- name: Checkout code
From e273279ad1c4072d65cd19284429182dc44b24e8 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 19 Mar 2023 20:54:45 +0100
Subject: [PATCH 112/159] fixed ci
---
.github/workflows/build.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 13a8963c..ead73237 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
ruby-version: [2.7.7, 3.0.5]
- fail-fast: false
+ fail-fast: false
steps:
- name: Checkout code
From c341fa7505f093dd8e4ea21386155cfaac719c39 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Sun, 19 Mar 2023 21:00:20 +0100
Subject: [PATCH 113/159] Do not test with ruby 3.0.5 for now
---
.github/workflows/build.yml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index ead73237..71fb4d13 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -11,7 +11,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
- ruby-version: [2.7.7, 3.0.5]
+ ruby-version:
+ - 2.7.7
+ # - 3.0.5 # TODO: Upgrade to Rails 6
fail-fast: false
steps:
From 3e70602d9b3256e089f8148a6b420019d1a83acc Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Mon, 20 Mar 2023 22:08:35 +0100
Subject: [PATCH 114/159] updated money-tree
---
Gemfile.lock | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/Gemfile.lock b/Gemfile.lock
index 2d0e65e9..bf000d24 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -151,7 +151,7 @@ GEM
faraday (1.1.0)
multipart-post (>= 1.2, < 3)
ruby2_keywords
- ffi (1.13.1)
+ ffi (1.15.5)
gherkin (5.1.0)
globalid (1.1.0)
activesupport (>= 5.0)
@@ -227,8 +227,7 @@ GEM
mini_mime (1.1.2)
mini_portile2 (2.8.1)
minitest (5.18.0)
- money-tree (0.10.0)
- ffi
+ money-tree (0.11.1)
multi_json (1.15.0)
multi_test (0.1.2)
multi_xml (0.6.0)
From cb11e69af7ff42d29d19a625f6e09790334578ad Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Mon, 20 Mar 2023 22:08:54 +0100
Subject: [PATCH 115/159] updated deploy script
---
config/deploy.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/deploy.rb b/config/deploy.rb
index 73aa10e3..3d155417 100644
--- a/config/deploy.rb
+++ b/config/deploy.rb
@@ -8,7 +8,7 @@
set :deploy_to, '/home/apps/t4c'
set :rvm_type, :user
-set :rvm_ruby_version, '2.6.6'
+set :rvm_ruby_version, '2.7.7'
set :rvm_custom_path, '~/.rvm'
set :format, :pretty
From 784ee59e6d78699f8ac602b0a78e094ad2ee3da7 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Mon, 20 Mar 2023 22:39:34 +0100
Subject: [PATCH 116/159] Upgraded ruby to 3.0 and Rails to 6.0
---
.github/workflows/build.yml | 5 +-
.rubocop.yml | 2 +-
.rubocop_todo.yml | 8 ++-
.tool-versions | 2 +-
Gemfile | 4 +-
Gemfile.lock | 118 ++++++++++++++++++++++--------------
app/models/wallet.rb | 2 +-
config/deploy.rb | 2 +-
db/schema.rb | 28 ++++-----
9 files changed, 103 insertions(+), 68 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 71fb4d13..67015d8a 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -12,8 +12,9 @@ jobs:
strategy:
matrix:
ruby-version:
- - 2.7.7
- # - 3.0.5 # TODO: Upgrade to Rails 6
+ - 3.0.5
+ - 3.1.3
+ - 3.2.1
fail-fast: false
steps:
diff --git a/.rubocop.yml b/.rubocop.yml
index 9352092f..5eee973d 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -6,7 +6,7 @@ require:
- rubocop-rspec
AllCops:
- TargetRubyVersion: 2.7
+ TargetRubyVersion: 3.0
NewCops: enable
Exclude:
- 'db/schema.rb'
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index cff5c871..5dc42ead 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
-# on 2023-03-19 15:30:48 UTC using RuboCop version 1.48.1.
+# on 2023-03-20 21:35:18 UTC using RuboCop version 1.48.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
@@ -33,6 +33,12 @@ Lint/OrAssignmentToConstant:
- 'config/application.rb'
- 'config/initializers/blacklist.rb'
+# Offense count: 1
+# This cop supports unsafe autocorrection (--autocorrect-all).
+Lint/RedundantDirGlobSort:
+ Exclude:
+ - 'spec/spec_helper.rb'
+
# Offense count: 15
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
Metrics/AbcSize:
diff --git a/.tool-versions b/.tool-versions
index 33a8789f..5de817ed 100644
--- a/.tool-versions
+++ b/.tool-versions
@@ -1 +1 @@
-ruby 2.7.7
+ruby 3.0.5
diff --git a/Gemfile b/Gemfile
index 5f2006d5..11d8047f 100644
--- a/Gemfile
+++ b/Gemfile
@@ -2,7 +2,7 @@
source 'https://rubygems.org'
-gem 'rails', '5.2.8.1'
+gem 'rails', '6.0.6.1'
gem 'acts_as_paranoid'
gem 'airbrake'
@@ -55,6 +55,8 @@ end
group :development, :test do
gem 'factory_bot_rails'
+ gem 'pry'
+ gem 'pry-byebug'
gem 'rspec-rails'
gem 'rubocop'
gem 'rubocop-rails'
diff --git a/Gemfile.lock b/Gemfile.lock
index bf000d24..88816826 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,47 +1,61 @@
GEM
remote: https://rubygems.org/
specs:
- actioncable (5.2.8.1)
- actionpack (= 5.2.8.1)
+ actioncable (6.0.6.1)
+ actionpack (= 6.0.6.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
- actionmailer (5.2.8.1)
- actionpack (= 5.2.8.1)
- actionview (= 5.2.8.1)
- activejob (= 5.2.8.1)
+ actionmailbox (6.0.6.1)
+ actionpack (= 6.0.6.1)
+ activejob (= 6.0.6.1)
+ activerecord (= 6.0.6.1)
+ activestorage (= 6.0.6.1)
+ activesupport (= 6.0.6.1)
+ mail (>= 2.7.1)
+ actionmailer (6.0.6.1)
+ actionpack (= 6.0.6.1)
+ actionview (= 6.0.6.1)
+ activejob (= 6.0.6.1)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
- actionpack (5.2.8.1)
- actionview (= 5.2.8.1)
- activesupport (= 5.2.8.1)
+ actionpack (6.0.6.1)
+ actionview (= 6.0.6.1)
+ activesupport (= 6.0.6.1)
rack (~> 2.0, >= 2.0.8)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
- actionview (5.2.8.1)
- activesupport (= 5.2.8.1)
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
+ actiontext (6.0.6.1)
+ actionpack (= 6.0.6.1)
+ activerecord (= 6.0.6.1)
+ activestorage (= 6.0.6.1)
+ activesupport (= 6.0.6.1)
+ nokogiri (>= 1.8.5)
+ actionview (6.0.6.1)
+ activesupport (= 6.0.6.1)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
- rails-html-sanitizer (~> 1.0, >= 1.0.3)
- activejob (5.2.8.1)
- activesupport (= 5.2.8.1)
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
+ activejob (6.0.6.1)
+ activesupport (= 6.0.6.1)
globalid (>= 0.3.6)
- activemodel (5.2.8.1)
- activesupport (= 5.2.8.1)
- activerecord (5.2.8.1)
- activemodel (= 5.2.8.1)
- activesupport (= 5.2.8.1)
- arel (>= 9.0)
- activestorage (5.2.8.1)
- actionpack (= 5.2.8.1)
- activerecord (= 5.2.8.1)
- marcel (~> 1.0.0)
- activesupport (5.2.8.1)
+ activemodel (6.0.6.1)
+ activesupport (= 6.0.6.1)
+ activerecord (6.0.6.1)
+ activemodel (= 6.0.6.1)
+ activesupport (= 6.0.6.1)
+ activestorage (6.0.6.1)
+ actionpack (= 6.0.6.1)
+ activejob (= 6.0.6.1)
+ activerecord (= 6.0.6.1)
+ marcel (~> 1.0)
+ activesupport (6.0.6.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
+ zeitwerk (~> 2.2, >= 2.2.2)
acts_as_paranoid (0.7.0)
activerecord (>= 5.2, < 7.0)
activesupport (>= 5.2, < 7.0)
@@ -53,7 +67,6 @@ GEM
rbtree3 (~> 0.5)
airbrussh (1.4.0)
sshkit (>= 1.6.1, != 1.7.0)
- arel (9.0.0)
ast (2.4.2)
backports (3.18.2)
bcrypt (3.1.16)
@@ -63,6 +76,7 @@ GEM
actionpack (>= 5.2)
activemodel (>= 5.2)
builder (3.2.4)
+ byebug (11.1.3)
cancancan (3.1.0)
capistrano (3.14.1)
airbrussh (>= 1.0.0)
@@ -85,6 +99,7 @@ GEM
rack-test (>= 0.6.3)
regexp_parser (~> 1.5)
xpath (~> 3.2)
+ coderay (1.1.3)
coffee-rails (5.0.0)
coffee-script (>= 2.2.0)
railties (>= 5.2.0)
@@ -275,23 +290,31 @@ GEM
parallel (1.22.1)
parser (3.2.1.1)
ast (~> 2.4.1)
+ pry (0.14.2)
+ coderay (~> 1.1)
+ method_source (~> 1.0)
+ pry-byebug (3.10.1)
+ byebug (~> 11.0)
+ pry (>= 0.13, < 0.15)
public_suffix (4.0.6)
racc (1.6.2)
rack (2.2.6.4)
rack-test (2.1.0)
rack (>= 1.3)
- rails (5.2.8.1)
- actioncable (= 5.2.8.1)
- actionmailer (= 5.2.8.1)
- actionpack (= 5.2.8.1)
- actionview (= 5.2.8.1)
- activejob (= 5.2.8.1)
- activemodel (= 5.2.8.1)
- activerecord (= 5.2.8.1)
- activestorage (= 5.2.8.1)
- activesupport (= 5.2.8.1)
+ rails (6.0.6.1)
+ actioncable (= 6.0.6.1)
+ actionmailbox (= 6.0.6.1)
+ actionmailer (= 6.0.6.1)
+ actionpack (= 6.0.6.1)
+ actiontext (= 6.0.6.1)
+ actionview (= 6.0.6.1)
+ activejob (= 6.0.6.1)
+ activemodel (= 6.0.6.1)
+ activerecord (= 6.0.6.1)
+ activestorage (= 6.0.6.1)
+ activesupport (= 6.0.6.1)
bundler (>= 1.3.0)
- railties (= 5.2.8.1)
+ railties (= 6.0.6.1)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
@@ -302,15 +325,15 @@ GEM
nokogiri (>= 1.6)
rails-html-sanitizer (1.5.0)
loofah (~> 2.19, >= 2.19.1)
- rails-i18n (5.1.3)
+ rails-i18n (7.0.6)
i18n (>= 0.7, < 2)
- railties (>= 5.0, < 6)
- railties (5.2.8.1)
- actionpack (= 5.2.8.1)
- activesupport (= 5.2.8.1)
+ railties (>= 6.0.0, < 8)
+ railties (6.0.6.1)
+ actionpack (= 6.0.6.1)
+ activesupport (= 6.0.6.1)
method_source
rake (>= 0.8.7)
- thor (>= 0.19.0, < 2.0)
+ thor (>= 0.20.3, < 2.0)
rainbow (3.1.1)
rake (13.0.6)
rbnacl (7.1.1)
@@ -443,6 +466,7 @@ GEM
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)
+ zeitwerk (2.6.7)
PLATFORMS
ruby
@@ -483,7 +507,9 @@ DEPENDENCIES
omniauth
omniauth-github
omniauth-rails_csrf_protection (~> 0.1)
- rails (= 5.2.8.1)
+ pry
+ pry-byebug
+ rails (= 6.0.6.1)
rails-controller-testing
rails-i18n
rbnacl
@@ -508,4 +534,4 @@ DEPENDENCIES
webmock
BUNDLED WITH
- 2.1.4
+ 2.4.8
diff --git a/app/models/wallet.rb b/app/models/wallet.rb
index 920f70b3..9b300cfa 100644
--- a/app/models/wallet.rb
+++ b/app/models/wallet.rb
@@ -4,7 +4,7 @@ class Wallet < ApplicationRecord
validates :name, :xpub, presence: true
def generate_address
- address = hd_wallet.node_for_path("0/#{last_address_index}.pub").to_address
+ address = address_by_index(last_address_index)
self.last_address_index += 1
save
address
diff --git a/config/deploy.rb b/config/deploy.rb
index 3d155417..a54b741f 100644
--- a/config/deploy.rb
+++ b/config/deploy.rb
@@ -8,7 +8,7 @@
set :deploy_to, '/home/apps/t4c'
set :rvm_type, :user
-set :rvm_ruby_version, '2.7.7'
+set :rvm_ruby_version, '3.0.5'
set :rvm_custom_path, '~/.rvm'
set :format, :pretty
diff --git a/db/schema.rb b/db/schema.rb
index dd94d3c1..3ea27b18 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -12,7 +12,7 @@
ActiveRecord::Schema.define(version: 2017_03_08_163825) do
- create_table "collaborators", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
+ create_table "collaborators", force: :cascade do |t|
t.integer "project_id"
t.string "login"
t.datetime "created_at"
@@ -20,18 +20,18 @@
t.index ["project_id"], name: "index_collaborators_on_project_id"
end
- create_table "deposits", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
+ create_table "deposits", force: :cascade do |t|
t.integer "project_id"
t.string "txid"
t.integer "confirmations"
t.datetime "created_at"
t.datetime "updated_at"
- t.bigint "amount"
+ t.integer "amount", limit: 8
t.float "fee_size"
t.index ["project_id"], name: "index_deposits_on_project_id"
end
- create_table "projects", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
+ create_table "projects", force: :cascade do |t|
t.string "url"
t.string "bitcoin_address"
t.datetime "created_at"
@@ -59,7 +59,7 @@
t.index ["github_id"], name: "index_projects_on_github_id", unique: true
end
- create_table "sendmanies", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
+ create_table "sendmanies", force: :cascade do |t|
t.string "txid"
t.text "data"
t.string "result"
@@ -68,7 +68,7 @@
t.datetime "updated_at"
end
- create_table "tipping_policies_texts", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
+ create_table "tipping_policies_texts", force: :cascade do |t|
t.integer "project_id"
t.integer "user_id"
t.text "text"
@@ -78,9 +78,9 @@
t.index ["user_id"], name: "index_tipping_policies_texts_on_user_id"
end
- create_table "tips", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
+ create_table "tips", force: :cascade do |t|
t.integer "user_id"
- t.bigint "amount"
+ t.integer "amount", limit: 8
t.integer "sendmany_id"
t.datetime "created_at"
t.datetime "updated_at"
@@ -94,7 +94,7 @@
t.index ["user_id"], name: "index_tips_on_user_id"
end
- create_table "users", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
+ create_table "users", force: :cascade do |t|
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.string "reset_password_token"
@@ -115,10 +115,10 @@
t.boolean "unsubscribed"
t.datetime "notified_at"
t.integer "commits_count", default: 0
- t.bigint "withdrawn_amount", default: 0
- t.datetime "confirmed_at"
- t.datetime "confirmation_sent_at"
+ t.integer "withdrawn_amount", limit: 8, default: 0
t.string "confirmation_token"
+ t.datetime "confirmation_sent_at"
+ t.datetime "confirmed_at"
t.string "unconfirmed_email"
t.string "display_name"
t.integer "denom", default: 0
@@ -126,10 +126,10 @@
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
end
- create_table "wallets", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
+ create_table "wallets", force: :cascade do |t|
t.string "name"
t.string "xpub"
- t.integer "last_address_index", default: 1
+ t.integer "last_address_index", limit: 4, default: 1
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
From 82a00a80a33e5ee095b62161d25f98f7c36990fd Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Mon, 20 Mar 2023 22:45:55 +0100
Subject: [PATCH 117/159] deprecated config
---
config/application.rb | 1 -
1 file changed, 1 deletion(-)
diff --git a/config/application.rb b/config/application.rb
index f4b595d1..fafdcf59 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -28,7 +28,6 @@ class Application < Rails::Application
config.autoload_paths += %W[#{config.root}/lib]
config.assets.initialize_on_precompile = true
config.available_locales = %w[en es fr nl ru pl hr de ro ko id ja pt my cn hk]
- config.active_record.sqlite3.represent_boolean_as_integer = true
end
end
From 9ac87b26edb7180f4f9d1cf025052c067257bfd9 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Mon, 20 Mar 2023 22:46:23 +0100
Subject: [PATCH 118/159] Do not test with Ruby > 3.0 for now
---
.github/workflows/build.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 67015d8a..9d9cc828 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -13,8 +13,8 @@ jobs:
matrix:
ruby-version:
- 3.0.5
- - 3.1.3
- - 3.2.1
+ # - 3.1.3
+ # - 3.2.1
fail-fast: false
steps:
From 24cbe258015228914cb52241f9ebd3e2c407a101 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Mon, 20 Mar 2023 22:53:46 +0100
Subject: [PATCH 119/159] Upgraded rails to 6.1
---
Gemfile | 2 +-
Gemfile.lock | 127 ++++++++++++++++++++++++++-------------------------
2 files changed, 66 insertions(+), 63 deletions(-)
diff --git a/Gemfile b/Gemfile
index 11d8047f..426ac566 100644
--- a/Gemfile
+++ b/Gemfile
@@ -2,7 +2,7 @@
source 'https://rubygems.org'
-gem 'rails', '6.0.6.1'
+gem 'rails', '6.1.7.3'
gem 'acts_as_paranoid'
gem 'airbrake'
diff --git a/Gemfile.lock b/Gemfile.lock
index 88816826..9a613850 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,61 +1,65 @@
GEM
remote: https://rubygems.org/
specs:
- actioncable (6.0.6.1)
- actionpack (= 6.0.6.1)
+ actioncable (6.1.7.3)
+ actionpack (= 6.1.7.3)
+ activesupport (= 6.1.7.3)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
- actionmailbox (6.0.6.1)
- actionpack (= 6.0.6.1)
- activejob (= 6.0.6.1)
- activerecord (= 6.0.6.1)
- activestorage (= 6.0.6.1)
- activesupport (= 6.0.6.1)
+ actionmailbox (6.1.7.3)
+ actionpack (= 6.1.7.3)
+ activejob (= 6.1.7.3)
+ activerecord (= 6.1.7.3)
+ activestorage (= 6.1.7.3)
+ activesupport (= 6.1.7.3)
mail (>= 2.7.1)
- actionmailer (6.0.6.1)
- actionpack (= 6.0.6.1)
- actionview (= 6.0.6.1)
- activejob (= 6.0.6.1)
+ actionmailer (6.1.7.3)
+ actionpack (= 6.1.7.3)
+ actionview (= 6.1.7.3)
+ activejob (= 6.1.7.3)
+ activesupport (= 6.1.7.3)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
- actionpack (6.0.6.1)
- actionview (= 6.0.6.1)
- activesupport (= 6.0.6.1)
- rack (~> 2.0, >= 2.0.8)
+ actionpack (6.1.7.3)
+ actionview (= 6.1.7.3)
+ activesupport (= 6.1.7.3)
+ rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
- actiontext (6.0.6.1)
- actionpack (= 6.0.6.1)
- activerecord (= 6.0.6.1)
- activestorage (= 6.0.6.1)
- activesupport (= 6.0.6.1)
+ actiontext (6.1.7.3)
+ actionpack (= 6.1.7.3)
+ activerecord (= 6.1.7.3)
+ activestorage (= 6.1.7.3)
+ activesupport (= 6.1.7.3)
nokogiri (>= 1.8.5)
- actionview (6.0.6.1)
- activesupport (= 6.0.6.1)
+ actionview (6.1.7.3)
+ activesupport (= 6.1.7.3)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
- activejob (6.0.6.1)
- activesupport (= 6.0.6.1)
+ activejob (6.1.7.3)
+ activesupport (= 6.1.7.3)
globalid (>= 0.3.6)
- activemodel (6.0.6.1)
- activesupport (= 6.0.6.1)
- activerecord (6.0.6.1)
- activemodel (= 6.0.6.1)
- activesupport (= 6.0.6.1)
- activestorage (6.0.6.1)
- actionpack (= 6.0.6.1)
- activejob (= 6.0.6.1)
- activerecord (= 6.0.6.1)
+ activemodel (6.1.7.3)
+ activesupport (= 6.1.7.3)
+ activerecord (6.1.7.3)
+ activemodel (= 6.1.7.3)
+ activesupport (= 6.1.7.3)
+ activestorage (6.1.7.3)
+ actionpack (= 6.1.7.3)
+ activejob (= 6.1.7.3)
+ activerecord (= 6.1.7.3)
+ activesupport (= 6.1.7.3)
marcel (~> 1.0)
- activesupport (6.0.6.1)
+ mini_mime (>= 1.1.0)
+ activesupport (6.1.7.3)
concurrent-ruby (~> 1.0, >= 1.0.2)
- i18n (>= 0.7, < 2)
- minitest (~> 5.1)
- tzinfo (~> 1.1)
- zeitwerk (~> 2.2, >= 2.2.2)
+ i18n (>= 1.6, < 2)
+ minitest (>= 5.1)
+ tzinfo (~> 2.0)
+ zeitwerk (~> 2.3)
acts_as_paranoid (0.7.0)
activerecord (>= 5.2, < 7.0)
activesupport (>= 5.2, < 7.0)
@@ -301,20 +305,20 @@ GEM
rack (2.2.6.4)
rack-test (2.1.0)
rack (>= 1.3)
- rails (6.0.6.1)
- actioncable (= 6.0.6.1)
- actionmailbox (= 6.0.6.1)
- actionmailer (= 6.0.6.1)
- actionpack (= 6.0.6.1)
- actiontext (= 6.0.6.1)
- actionview (= 6.0.6.1)
- activejob (= 6.0.6.1)
- activemodel (= 6.0.6.1)
- activerecord (= 6.0.6.1)
- activestorage (= 6.0.6.1)
- activesupport (= 6.0.6.1)
- bundler (>= 1.3.0)
- railties (= 6.0.6.1)
+ rails (6.1.7.3)
+ actioncable (= 6.1.7.3)
+ actionmailbox (= 6.1.7.3)
+ actionmailer (= 6.1.7.3)
+ actionpack (= 6.1.7.3)
+ actiontext (= 6.1.7.3)
+ actionview (= 6.1.7.3)
+ activejob (= 6.1.7.3)
+ activemodel (= 6.1.7.3)
+ activerecord (= 6.1.7.3)
+ activestorage (= 6.1.7.3)
+ activesupport (= 6.1.7.3)
+ bundler (>= 1.15.0)
+ railties (= 6.1.7.3)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
@@ -328,12 +332,12 @@ GEM
rails-i18n (7.0.6)
i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 8)
- railties (6.0.6.1)
- actionpack (= 6.0.6.1)
- activesupport (= 6.0.6.1)
+ railties (6.1.7.3)
+ actionpack (= 6.1.7.3)
+ activesupport (= 6.1.7.3)
method_source
- rake (>= 0.8.7)
- thor (>= 0.20.3, < 2.0)
+ rake (>= 12.2)
+ thor (~> 1.0)
rainbow (3.1.1)
rake (13.0.6)
rbnacl (7.1.1)
@@ -435,7 +439,6 @@ GEM
net-ssh (>= 2.8.0)
temple (0.8.2)
thor (1.2.1)
- thread_safe (0.3.6)
tilt (2.0.10)
timeout (0.3.2)
turbolinks (5.2.1)
@@ -446,8 +449,8 @@ GEM
execjs (>= 2.2.2, >= 2.2)
less-rails (>= 2.5.0)
railties (>= 3.1)
- tzinfo (1.2.11)
- thread_safe (~> 0.1)
+ tzinfo (2.0.6)
+ concurrent-ruby (~> 1.0)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unf (0.1.4)
@@ -509,7 +512,7 @@ DEPENDENCIES
omniauth-rails_csrf_protection (~> 0.1)
pry
pry-byebug
- rails (= 6.0.6.1)
+ rails (= 6.1.7.3)
rails-controller-testing
rails-i18n
rbnacl
From 1981519e0355261a1e8e34307ede2cbdbcb8297b Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Mon, 20 Mar 2023 22:57:23 +0100
Subject: [PATCH 120/159] fixed deprecation warning
---
lib/bitcoin_address_validator.rb | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/bitcoin_address_validator.rb b/lib/bitcoin_address_validator.rb
index 577a0f59..c2c69a42 100644
--- a/lib/bitcoin_address_validator.rb
+++ b/lib/bitcoin_address_validator.rb
@@ -4,7 +4,9 @@
class BitcoinAddressValidator < ActiveModel::EachValidator
def validate_each(record, field, value)
- record.errors[field] << 'Bitcoin address is invalid' unless value.blank? || valid_bitcoin_address?(value)
+ return if value.blank? || valid_bitcoin_address?(value)
+
+ record.errors.add(field, :invalid, message: 'Bitcoin address is invalid')
end
private
From 2fba1a92f428c077784477af48d3c3987293d09b Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 20 Mar 2023 23:10:56 +0100
Subject: [PATCH 121/159] Bump rdoc from 6.2.1 to 6.5.0 (#438)
Bumps [rdoc](https://github.com/ruby/rdoc) from 6.2.1 to 6.5.0.
- [Release notes](https://github.com/ruby/rdoc/releases)
- [Changelog](https://github.com/ruby/rdoc/blob/master/History.rdoc)
- [Commits](https://github.com/ruby/rdoc/compare/v6.2.1...v6.5.0)
---
updated-dependencies:
- dependency-name: rdoc
dependency-type: indirect
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
Gemfile.lock | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/Gemfile.lock b/Gemfile.lock
index 9a613850..5b43f400 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -300,6 +300,8 @@ GEM
pry-byebug (3.10.1)
byebug (~> 11.0)
pry (>= 0.13, < 0.15)
+ psych (5.1.0)
+ stringio
public_suffix (4.0.6)
racc (1.6.2)
rack (2.2.6.4)
@@ -343,7 +345,8 @@ GEM
rbnacl (7.1.1)
ffi
rbtree3 (0.6.0)
- rdoc (6.2.1)
+ rdoc (6.5.0)
+ psych (>= 4.0.0)
regexp_parser (1.8.2)
render_csv (2.0.0)
rails (>= 3.0)
@@ -437,6 +440,7 @@ GEM
sshkit (1.21.1)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
+ stringio (3.0.5)
temple (0.8.2)
thor (1.2.1)
tilt (2.0.10)
From 4af9229329637b0d03bd92132c352f90e1ea1f84 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 21 Mar 2023 08:54:59 +0100
Subject: [PATCH 122/159] Bump addressable from 2.7.0 to 2.8.1 (#428)
Bumps [addressable](https://github.com/sporkmonger/addressable) from 2.7.0 to 2.8.1.
- [Release notes](https://github.com/sporkmonger/addressable/releases)
- [Changelog](https://github.com/sporkmonger/addressable/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sporkmonger/addressable/compare/addressable-2.7.0...addressable-2.8.1)
---
updated-dependencies:
- dependency-name: addressable
dependency-type: indirect
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
Gemfile.lock | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Gemfile.lock b/Gemfile.lock
index 5b43f400..58ff014c 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -63,8 +63,8 @@ GEM
acts_as_paranoid (0.7.0)
activerecord (>= 5.2, < 7.0)
activesupport (>= 5.2, < 7.0)
- addressable (2.7.0)
- public_suffix (>= 2.0.2, < 5.0)
+ addressable (2.8.1)
+ public_suffix (>= 2.0.2, < 6.0)
airbrake (11.0.1)
airbrake-ruby (~> 5.1)
airbrake-ruby (5.2.0)
@@ -302,7 +302,7 @@ GEM
pry (>= 0.13, < 0.15)
psych (5.1.0)
stringio
- public_suffix (4.0.6)
+ public_suffix (5.0.1)
racc (1.6.2)
rack (2.2.6.4)
rack-test (2.1.0)
From 47b16d3023bd26403ea24c8b862ba8ba1b637c13 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Tue, 21 Mar 2023 14:09:11 +0100
Subject: [PATCH 123/159] added puma and updated bin folder
---
Gemfile | 1 +
Gemfile.lock | 9 +++++----
bin/rails | 4 ++--
bin/rake | 4 ++--
bin/setup | 16 ++++++++--------
bin/yarn | 12 +++++++++---
db/schema.rb | 10 +++++-----
7 files changed, 32 insertions(+), 24 deletions(-)
diff --git a/Gemfile b/Gemfile
index 426ac566..c7b7bcf5 100644
--- a/Gemfile
+++ b/Gemfile
@@ -30,6 +30,7 @@ gem 'octokit'
gem 'omniauth'
gem 'omniauth-github'
gem 'omniauth-rails_csrf_protection', '~> 0.1'
+gem 'puma'
gem 'rails-i18n'
gem 'render_csv'
gem 'rest-client'
diff --git a/Gemfile.lock b/Gemfile.lock
index 58ff014c..834ab7a3 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -244,7 +244,6 @@ GEM
mime-types-data (~> 3.2015)
mime-types-data (3.2020.1104)
mini_mime (1.1.2)
- mini_portile2 (2.8.1)
minitest (5.18.0)
money-tree (0.11.1)
multi_json (1.15.0)
@@ -266,8 +265,7 @@ GEM
net-ssh (6.1.0)
netrc (0.11.0)
nio4r (2.5.8)
- nokogiri (1.14.2)
- mini_portile2 (~> 2.8.0)
+ nokogiri (1.14.2-arm64-darwin)
racc (~> 1.4)
oauth2 (1.4.4)
faraday (>= 0.8, < 2.0)
@@ -303,6 +301,8 @@ GEM
psych (5.1.0)
stringio
public_suffix (5.0.1)
+ puma (6.1.1)
+ nio4r (~> 2.0)
racc (1.6.2)
rack (2.2.6.4)
rack-test (2.1.0)
@@ -476,7 +476,7 @@ GEM
zeitwerk (2.6.7)
PLATFORMS
- ruby
+ arm64-darwin-22
DEPENDENCIES
acts_as_paranoid
@@ -516,6 +516,7 @@ DEPENDENCIES
omniauth-rails_csrf_protection (~> 0.1)
pry
pry-byebug
+ puma
rails (= 6.1.7.3)
rails-controller-testing
rails-i18n
diff --git a/bin/rails b/bin/rails
index 07396602..6fb4e405 100755
--- a/bin/rails
+++ b/bin/rails
@@ -1,4 +1,4 @@
#!/usr/bin/env ruby
APP_PATH = File.expand_path('../config/application', __dir__)
-require_relative '../config/boot'
-require 'rails/commands'
+require_relative "../config/boot"
+require "rails/commands"
diff --git a/bin/rake b/bin/rake
index 17240489..4fbf10b9 100755
--- a/bin/rake
+++ b/bin/rake
@@ -1,4 +1,4 @@
#!/usr/bin/env ruby
-require_relative '../config/boot'
-require 'rake'
+require_relative "../config/boot"
+require "rake"
Rake.application.run
diff --git a/bin/setup b/bin/setup
index 94fd4d79..90700ac4 100755
--- a/bin/setup
+++ b/bin/setup
@@ -1,6 +1,5 @@
#!/usr/bin/env ruby
-require 'fileutils'
-include FileUtils
+require "fileutils"
# path to your application root.
APP_ROOT = File.expand_path('..', __dir__)
@@ -9,24 +8,25 @@ def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
end
-chdir APP_ROOT do
- # This script is a starting point to setup your application.
+FileUtils.chdir APP_ROOT do
+ # This script is a way to set up or update your development environment automatically.
+ # This script is idempotent, so that you can run it at any time and get an expectable outcome.
# Add necessary setup steps to this file.
puts '== Installing dependencies =='
system! 'gem install bundler --conservative'
system('bundle check') || system!('bundle install')
- # Install JavaScript dependencies if using Yarn
- # system('bin/yarn')
+ # Install JavaScript dependencies
+ system! 'bin/yarn'
# puts "\n== Copying sample files =="
# unless File.exist?('config/database.yml')
- # cp 'config/database.yml.sample', 'config/database.yml'
+ # FileUtils.cp 'config/database.yml.sample', 'config/database.yml'
# end
puts "\n== Preparing database =="
- system! 'bin/rails db:setup'
+ system! 'bin/rails db:prepare'
puts "\n== Removing old logs and tempfiles =="
system! 'bin/rails log:clear tmp:clear'
diff --git a/bin/yarn b/bin/yarn
index 460dd565..9fab2c35 100755
--- a/bin/yarn
+++ b/bin/yarn
@@ -1,9 +1,15 @@
#!/usr/bin/env ruby
APP_ROOT = File.expand_path('..', __dir__)
Dir.chdir(APP_ROOT) do
- begin
- exec "yarnpkg", *ARGV
- rescue Errno::ENOENT
+ yarn = ENV["PATH"].split(File::PATH_SEPARATOR).
+ select { |dir| File.expand_path(dir) != __dir__ }.
+ product(["yarn", "yarn.cmd", "yarn.ps1"]).
+ map { |dir, file| File.expand_path(file, dir) }.
+ find { |file| File.executable?(file) }
+
+ if yarn
+ exec yarn, *ARGV
+ else
$stderr.puts "Yarn executable was not detected in the system."
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
exit 1
diff --git a/db/schema.rb b/db/schema.rb
index 3ea27b18..4227cedf 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -2,11 +2,11 @@
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
-# Note that this schema.rb definition is the authoritative source for your
-# database schema. If you need to create the application database on another
-# system, you should be using db:schema:load, not running all the migrations
-# from scratch. The latter is a flawed and unsustainable approach (the more migrations
-# you'll amass, the slower it'll run and the greater likelihood for issues).
+# This file is the source Rails uses to define your schema when running `bin/rails
+# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
+# be faster and is potentially less error prone than running all of your
+# migrations from scratch. Old migrations may fail to apply correctly if those
+# migrations use external dependencies or application code.
#
# It's strongly recommended that you check this file into your version control system.
From e2319986de48f0834523c61cbfb98098b8bd4f5f Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Tue, 21 Mar 2023 14:11:16 +0100
Subject: [PATCH 124/159] deprecation warning
---
app/views/devise/confirmations/new.html.haml | 2 +-
app/views/devise/passwords/edit.html.haml | 2 +-
app/views/devise/passwords/new.html.haml | 2 +-
app/views/devise/unlocks/new.html.haml | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/views/devise/confirmations/new.html.haml b/app/views/devise/confirmations/new.html.haml
index 4cbba835..0dbbffa5 100644
--- a/app/views/devise/confirmations/new.html.haml
+++ b/app/views/devise/confirmations/new.html.haml
@@ -1,6 +1,6 @@
= bootstrap_form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post, class: 'form-devise' }) do |f|
%h2= t('.title')
- = devise_error_messages!
+ = render "devise/shared/error_messages", resource: resource
= f.email_field :email, :autofocus => true
= f.submit t('.submit'), class: 'btn btn-primary'
%p
diff --git a/app/views/devise/passwords/edit.html.haml b/app/views/devise/passwords/edit.html.haml
index 024a7f6d..55309a98 100644
--- a/app/views/devise/passwords/edit.html.haml
+++ b/app/views/devise/passwords/edit.html.haml
@@ -1,6 +1,6 @@
= bootstrap_form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put, class: 'form-devise' }) do |f|
%h2= t('.title')
- = devise_error_messages!
+ = render "devise/shared/error_messages", resource: resource
= f.hidden_field :reset_password_token
= f.password_field :password, :autofocus => true, :autocomplete => "off"
= f.password_field :password_confirmation, :autocomplete => "off"
diff --git a/app/views/devise/passwords/new.html.haml b/app/views/devise/passwords/new.html.haml
index ff2947a9..5eff00b0 100644
--- a/app/views/devise/passwords/new.html.haml
+++ b/app/views/devise/passwords/new.html.haml
@@ -1,6 +1,6 @@
= bootstrap_form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post, class: 'form-devise', role: 'form' }) do |f|
%h2= t('.title')
- = devise_error_messages!
+ = render "devise/shared/error_messages", resource: resource
= f.email_field :email, :autofocus => true
= f.submit t('.submit'), class: 'btn btn-primary'
%p
diff --git a/app/views/devise/unlocks/new.html.haml b/app/views/devise/unlocks/new.html.haml
index d3c87d07..932e66f4 100644
--- a/app/views/devise/unlocks/new.html.haml
+++ b/app/views/devise/unlocks/new.html.haml
@@ -1,6 +1,6 @@
%h2 Resend unlock instructions
= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f|
- = devise_error_messages!
+ = render "devise/shared/error_messages", resource: resource
%div
= f.label :email
%br/
From 5a93ef75a7039527be2f83007c8c39dc0fcc5fc3 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Tue, 21 Mar 2023 14:13:42 +0100
Subject: [PATCH 125/159] platform
---
Gemfile.lock | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Gemfile.lock b/Gemfile.lock
index 834ab7a3..48bdd60c 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -476,7 +476,7 @@ GEM
zeitwerk (2.6.7)
PLATFORMS
- arm64-darwin-22
+ ruby
DEPENDENCIES
acts_as_paranoid
From 649181ccd6a1666ddecfa5967665e64a042f792a Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Tue, 21 Mar 2023 14:15:16 +0100
Subject: [PATCH 126/159] fixed platforms
---
Gemfile.lock | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Gemfile.lock b/Gemfile.lock
index 48bdd60c..b8b39046 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -476,7 +476,8 @@ GEM
zeitwerk (2.6.7)
PLATFORMS
- ruby
+ arm64-darwin-22
+ x86_64-linux
DEPENDENCIES
acts_as_paranoid
From d7adcc4afc10a8052e2c4def393ad9e874181e93 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Tue, 21 Mar 2023 14:24:16 +0100
Subject: [PATCH 127/159] rubocop: autocorrection
---
.rubocop_todo.yml | 93 +------------------
app/controllers/users_controller.rb | 8 +-
app/models/project.rb | 2 +-
config.ru | 2 +-
config/environments/production.rb | 2 +-
config/routes.rb | 4 +-
...081507_add_bitcoin_address2_to_projects.rb | 3 +-
features/step_definitions/common.rb | 23 ++---
features/support/ostruct_slice.rb | 4 +-
lib/bitcoin_address_validator.rb | 2 +-
lib/tasks/cucumber.rake | 4 +-
spec/controllers/projects_controller_spec.rb | 2 +-
spec/factories/wallets.rb | 2 +-
spec/spec_helper.rb | 2 +-
14 files changed, 33 insertions(+), 120 deletions(-)
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 5dc42ead..a0d17a26 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -1,31 +1,11 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
-# on 2023-03-20 21:35:18 UTC using RuboCop version 1.48.1.
+# on 2023-03-21 13:21:19 UTC using RuboCop version 1.48.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
-# Offense count: 1
-# This cop supports safe autocorrection (--autocorrect).
-# Configuration parameters: EnforcedStyle, IndentationWidth.
-# SupportedStyles: aligned, indented
-Layout/LineEndStringConcatenationIndentation:
- Exclude:
- - 'spec/factories/wallets.rb'
-
-# Offense count: 1
-# This cop supports safe autocorrection (--autocorrect).
-Lint/AmbiguousOperatorPrecedence:
- Exclude:
- - 'lib/bitcoin_address_validator.rb'
-
-# Offense count: 1
-# This cop supports safe autocorrection (--autocorrect).
-Lint/ElseLayout:
- Exclude:
- - 'features/step_definitions/common.rb'
-
# Offense count: 2
# This cop supports unsafe autocorrection (--autocorrect-all).
Lint/OrAssignmentToConstant:
@@ -63,7 +43,7 @@ Metrics/CyclomaticComplexity:
# Offense count: 16
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
Metrics/MethodLength:
- Max: 29
+ Max: 30
# Offense count: 2
# Configuration parameters: AllowedMethods, AllowedPatterns.
@@ -98,14 +78,6 @@ RSpec/ContextWording:
RSpec/ExampleLength:
Max: 16
-# Offense count: 1
-# This cop supports safe autocorrection (--autocorrect).
-# Configuration parameters: EnforcedStyle.
-# SupportedStyles: require_parentheses, omit_parentheses
-RSpec/FactoryBot/ConsistentParenthesesStyle:
- Exclude:
- - 'spec/controllers/projects_controller_spec.rb'
-
# Offense count: 1
# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
# Include: **/*_spec*rb*, **/spec/**/*
@@ -168,36 +140,12 @@ RSpec/SubjectDeclaration:
- 'spec/controllers/projects_controller_spec.rb'
- 'spec/controllers/users_controller_spec.rb'
-# Offense count: 1
-# This cop supports safe autocorrection (--autocorrect).
-# Configuration parameters: ExpectedOrder, Include.
-# ExpectedOrder: index, show, new, edit, create, update, destroy
-# Include: app/controllers/**/*.rb
-Rails/ActionOrder:
- Exclude:
- - 'app/controllers/users_controller.rb'
-
# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Rails/ActiveSupportOnLoad:
Exclude:
- 'config/initializers/demoji.rb'
-# Offense count: 1
-# This cop supports safe autocorrection (--autocorrect).
-# Configuration parameters: Include.
-# Include: db/migrate/*.rb
-Rails/AddColumnIndex:
- Exclude:
- - 'db/migrate/20151219081507_add_bitcoin_address2_to_projects.rb'
-
-# Offense count: 1
-# This cop supports unsafe autocorrection (--autocorrect-all).
-# Configuration parameters: Severity.
-Rails/DeprecatedActiveModelErrorsMethods:
- Exclude:
- - 'lib/bitcoin_address_validator.rb'
-
# Offense count: 1
# Configuration parameters: EnforcedStyle.
# SupportedStyles: slashes, arguments
@@ -239,20 +187,6 @@ Rails/SkipsModelValidations:
- 'db/migrate/20140402082149_add_fee_size_to_deposits.rb'
- 'lib/bitcoin_tipper.rb'
-# Offense count: 2
-# This cop supports safe autocorrection (--autocorrect).
-# Configuration parameters: AllowOnlyRestArgument.
-Style/ArgumentsForwarding:
- Exclude:
- - 'features/support/ostruct_slice.rb'
-
-# Offense count: 1
-# This cop supports safe autocorrection (--autocorrect).
-# Configuration parameters: AllowSplatArgument.
-Style/HashConversion:
- Exclude:
- - 'app/models/project.rb'
-
# Offense count: 1
Style/MissingRespondToMissing:
Exclude:
@@ -263,35 +197,12 @@ Style/OpenStructUse:
Exclude:
- 'features/support/to_ostruct.rb'
-# Offense count: 5
-# This cop supports safe autocorrection (--autocorrect).
-Style/RedundantConstantBase:
- Exclude:
- - 'config.ru'
- - 'config/environments/production.rb'
- - 'lib/tasks/cucumber.rake'
- - 'spec/spec_helper.rb'
-
-# Offense count: 2
-# This cop supports safe autocorrection (--autocorrect).
-Style/RedundantRegexpEscape:
- Exclude:
- - 'config/routes.rb'
-
# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/SelectByRegexp:
Exclude:
- 'spec/routing/users_routing_spec.rb'
-# Offense count: 1
-# This cop supports safe autocorrection (--autocorrect).
-# Configuration parameters: EnforcedStyle, MinSize, WordRegex.
-# SupportedStyles: percent, brackets
-Style/WordArray:
- Exclude:
- - 'lib/tasks/cucumber.rake'
-
# Offense count: 25
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index df127c1d..75ca81d6 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -4,15 +4,15 @@ class UsersController < ApplicationController
before_action :authenticate_user!, :load_user, :valid_user!, except: %i[login index]
before_action :redirect_to_pretty_url, only: [:show]
+ def index
+ @users = User.order(withdrawn_amount: :desc, commits_count: :desc).where('commits_count > 0 AND withdrawn_amount > 0').page(params[:page]).per(30)
+ end
+
def show
@user_tips = @user.tips
@recent_tips = @user_tips.includes(:project).order(created_at: :desc).first(5)
end
- def index
- @users = User.order(withdrawn_amount: :desc, commits_count: :desc).where('commits_count > 0 AND withdrawn_amount > 0').page(params[:page]).per(30)
- end
-
def update
if @user.update(users_params)
redirect_to @user, notice: I18n.t('notices.user_updated')
diff --git a/app/models/project.rb b/app/models/project.rb
index a9b7fdcb..8b2effb0 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -236,7 +236,7 @@ def generate_bitcoin_address
class << self
def export_labels
- Hash[pluck(:bitcoin_address, :full_name)].to_json
+ pluck(:bitcoin_address, :full_name).to_h.to_json
end
def find_by_service_and_repo(service, repo)
diff --git a/config.ru b/config.ru
index 667e328d..afd13e21 100644
--- a/config.ru
+++ b/config.ru
@@ -2,5 +2,5 @@
# This file is used by Rack-based servers to start the application.
-require ::File.expand_path('config/environment', __dir__)
+require File.expand_path('config/environment', __dir__)
run Rails.application
diff --git a/config/environments/production.rb b/config/environments/production.rb
index d2103f50..034d4342 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -84,5 +84,5 @@
# config.autoflush_log = false
# Use default logging formatter so that PID and timestamp are not suppressed.
- config.log_formatter = ::Logger::Formatter.new
+ config.log_formatter = Logger::Formatter.new
end
diff --git a/config/routes.rb b/config/routes.rb
index 03fe0cd4..c1f67992 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -8,9 +8,9 @@
get '/users/login' => 'users#login', :as => 'login_users'
get '/users/:user_id/tips' => 'tips#index', :constraints => { user_id: /\d+/ }, :as => 'user_tips'
- get '/users/:nickname/tips' => 'tips#index', :constraints => { nickname: /\w[\d\w\-]*/ }, :as => 'user_tips_pretty'
+ get '/users/:nickname/tips' => 'tips#index', :constraints => { nickname: /\w[\d\w-]*/ }, :as => 'user_tips_pretty'
get '/users/:id' => 'users#show', :constraints => { id: /\d+/ }, :as => 'user'
- get '/users/:nickname' => 'users#show', :constraints => { nickname: /\w[\d\w\-]*/ }, :as => 'user_pretty'
+ get '/users/:nickname' => 'users#show', :constraints => { nickname: /\w[\d\w-]*/ }, :as => 'user_pretty'
get '/projects/:project_id/tips' => 'tips#index', :constraints => { project_id: /\d+/ }, :as => 'project_tips'
get '/projects/:project_id/deposits' => 'deposits#index', :constraints => { project_id: /\d+/ }, :as => 'project_deposits'
diff --git a/db/migrate/20151219081507_add_bitcoin_address2_to_projects.rb b/db/migrate/20151219081507_add_bitcoin_address2_to_projects.rb
index 4ac4957d..1f4122d4 100644
--- a/db/migrate/20151219081507_add_bitcoin_address2_to_projects.rb
+++ b/db/migrate/20151219081507_add_bitcoin_address2_to_projects.rb
@@ -2,7 +2,8 @@
class AddBitcoinAddress2ToProjects < ActiveRecord::Migration[4.2]
def change
- add_column :projects, :bitcoin_address2, :string, index: true
+ add_column :projects, :bitcoin_address2, :string
+ add_index :projects, :bitcoin_address2
reversible do |dir|
dir.up do
Project.find_each(&:generate_address2)
diff --git a/features/step_definitions/common.rb b/features/step_definitions/common.rb
index 2a7f96a3..dc5307e3 100644
--- a/features/step_definitions/common.rb
+++ b/features/step_definitions/common.rb
@@ -89,17 +89,18 @@ def parse_path_from_page_string(page_string)
path = "/users/#{name}/#{action}" if is_valid_path # TODO: nyi
# implicit cases
- else case page_string
- when 'home' then path = root_path
- when 'sign_up' then path = new_user_registration_path
- when 'sign_in' then path = new_user_session_path
- when 'users' then path = users_path
- when 'projects' then path = projects_path
- when 'search' then path = search_projects_path
- when 'tips' then path = tips_path
- when 'deposits' then path = deposits_path
- when 'withdrawals' then path = withdrawals_path
- end
+ else
+ case page_string
+ when 'home' then path = root_path
+ when 'sign_up' then path = new_user_registration_path
+ when 'sign_in' then path = new_user_session_path
+ when 'users' then path = users_path
+ when 'projects' then path = projects_path
+ when 'search' then path = search_projects_path
+ when 'tips' then path = tips_path
+ when 'deposits' then path = deposits_path
+ when 'withdrawals' then path = withdrawals_path
+ end
end
path || page_string
diff --git a/features/support/ostruct_slice.rb b/features/support/ostruct_slice.rb
index 95e6ac4d..3267fe82 100644
--- a/features/support/ostruct_slice.rb
+++ b/features/support/ostruct_slice.rb
@@ -3,7 +3,7 @@
require 'ostruct'
class OpenStruct
- def slice(*args, &block)
- marshal_dump.slice(*args, &block)
+ def slice(...)
+ marshal_dump.slice(...)
end
end
diff --git a/lib/bitcoin_address_validator.rb b/lib/bitcoin_address_validator.rb
index c2c69a42..069f390b 100644
--- a/lib/bitcoin_address_validator.rb
+++ b/lib/bitcoin_address_validator.rb
@@ -85,7 +85,7 @@ def b58_decode(value, length)
result = long_value.chr + result
- result = 0.chr * (length - result.length) + result if result.length < length
+ result = (0.chr * (length - result.length)) + result if result.length < length
result
end
diff --git a/lib/tasks/cucumber.rake b/lib/tasks/cucumber.rake
index e279deb6..18999e06 100644
--- a/lib/tasks/cucumber.rake
+++ b/lib/tasks/cucumber.rake
@@ -38,8 +38,8 @@ unless ARGV.any? { |a| a =~ /^gems/ } # Don't load anything when running the gem
task statsetup: :environment do
require 'rails/code_statistics'
- ::STATS_DIRECTORIES << %w[Cucumber\ features features] if File.exist?('features')
- ::CodeStatistics::TEST_TYPES << 'Cucumber features' if File.exist?('features')
+ STATS_DIRECTORIES << ['Cucumber features', 'features'] if File.exist?('features')
+ CodeStatistics::TEST_TYPES << 'Cucumber features' if File.exist?('features')
end
end
desc 'Alias for cucumber:ok'
diff --git a/spec/controllers/projects_controller_spec.rb b/spec/controllers/projects_controller_spec.rb
index c166f257..743fc801 100644
--- a/spec/controllers/projects_controller_spec.rb
+++ b/spec/controllers/projects_controller_spec.rb
@@ -69,7 +69,7 @@
# end
shared_context 'accessing_project' do |verb, action|
- let(:a_project) { create :project, host: 'github', full_name: 'test/test' }
+ let(:a_project) { create(:project, host: 'github', full_name: 'test/test') }
context 'with existsing project' do
it 'via project id returns 302 status code' do
diff --git a/spec/factories/wallets.rb b/spec/factories/wallets.rb
index 9c2f74d9..61c3a212 100644
--- a/spec/factories/wallets.rb
+++ b/spec/factories/wallets.rb
@@ -5,7 +5,7 @@
name { 'test wallet' }
xpub do
'xpub661MyMwAqRbcFepxYZyGLKMTkTPDvbfLaoYDbw4d4iQT5SycGiJQREuraJ2N6Uh' \
- 'LGPcjXDhnARdtcUhgqN3a2dgQ3Dx8u1chtk8Rx16LrWg'
+ 'LGPcjXDhnARdtcUhgqN3a2dgQ3Dx8u1chtk8Rx16LrWg'
end
end
end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 9231f65f..27a1ad36 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -40,7 +40,7 @@
# config.mock_with :rr
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
- config.fixture_path = "#{::Rails.root}/spec/fixtures"
+ config.fixture_path = "#{Rails.root}/spec/fixtures"
# If you're not using ActiveRecord, or you'd prefer not to run each of your
# examples within a transaction, remove the following line or assign false
# instead of true.
From 9c082e3d43e584edb94a40246e4ead7659a657ff Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Tue, 10 Oct 2023 23:15:30 +0200
Subject: [PATCH 128/159] Use mempool as explorer
---
app/helpers/application_helper.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 835a0fdd..e4474169 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -29,6 +29,6 @@ def list_friendly_text(a_list, conjunction)
end
def block_explorer_tx_url(txid)
- "https://tradeblock.com/bitcoin/tx/#{txid}"
+ "https://mempool.space/tx/#{txid}"
end
end
From b8df76c64a0a5d7e5ae616196bc147334046cccd Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 10 Oct 2023 23:21:03 +0200
Subject: [PATCH 129/159] Bump nokogiri from 1.14.2 to 1.15.4 (#441)
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.14.2 to 1.15.4.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.14.2...v1.15.4)
---
updated-dependencies:
- dependency-name: nokogiri
dependency-type: indirect
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
Gemfile.lock | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/Gemfile.lock b/Gemfile.lock
index b8b39046..3e8f2f55 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -265,7 +265,9 @@ GEM
net-ssh (6.1.0)
netrc (0.11.0)
nio4r (2.5.8)
- nokogiri (1.14.2-arm64-darwin)
+ nokogiri (1.15.4-arm64-darwin)
+ racc (~> 1.4)
+ nokogiri (1.15.4-x86_64-linux)
racc (~> 1.4)
oauth2 (1.4.4)
faraday (>= 0.8, < 2.0)
@@ -303,7 +305,7 @@ GEM
public_suffix (5.0.1)
puma (6.1.1)
nio4r (~> 2.0)
- racc (1.6.2)
+ racc (1.7.1)
rack (2.2.6.4)
rack-test (2.1.0)
rack (>= 1.3)
From 7290414360867aa8ea898058cddfb5202cb3903b Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Wed, 11 Oct 2023 10:20:18 +0200
Subject: [PATCH 130/159] Bump puma from 6.1.1 to 6.3.1 (#442)
Bumps [puma](https://github.com/puma/puma) from 6.1.1 to 6.3.1.
- [Release notes](https://github.com/puma/puma/releases)
- [Changelog](https://github.com/puma/puma/blob/master/History.md)
- [Commits](https://github.com/puma/puma/compare/v6.1.1...v6.3.1)
---
updated-dependencies:
- dependency-name: puma
dependency-type: direct:production
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
Gemfile.lock | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Gemfile.lock b/Gemfile.lock
index 3e8f2f55..df5bef1b 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -264,7 +264,7 @@ GEM
net-protocol
net-ssh (6.1.0)
netrc (0.11.0)
- nio4r (2.5.8)
+ nio4r (2.5.9)
nokogiri (1.15.4-arm64-darwin)
racc (~> 1.4)
nokogiri (1.15.4-x86_64-linux)
@@ -303,7 +303,7 @@ GEM
psych (5.1.0)
stringio
public_suffix (5.0.1)
- puma (6.1.1)
+ puma (6.3.1)
nio4r (~> 2.0)
racc (1.7.1)
rack (2.2.6.4)
From ba36e02cd62eba01d70479ac6241dd2faa682546 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Wed, 27 Mar 2024 11:58:45 +0100
Subject: [PATCH 131/159] Bump rdoc from 6.5.0 to 6.6.3.1 (#448)
Bumps [rdoc](https://github.com/ruby/rdoc) from 6.5.0 to 6.6.3.1.
- [Release notes](https://github.com/ruby/rdoc/releases)
- [Changelog](https://github.com/ruby/rdoc/blob/master/History.rdoc)
- [Commits](https://github.com/ruby/rdoc/compare/v6.5.0...v6.6.3.1)
---
updated-dependencies:
- dependency-name: rdoc
dependency-type: indirect
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
Gemfile.lock | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Gemfile.lock b/Gemfile.lock
index df5bef1b..2bde5313 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -300,7 +300,7 @@ GEM
pry-byebug (3.10.1)
byebug (~> 11.0)
pry (>= 0.13, < 0.15)
- psych (5.1.0)
+ psych (5.1.2)
stringio
public_suffix (5.0.1)
puma (6.3.1)
@@ -347,7 +347,7 @@ GEM
rbnacl (7.1.1)
ffi
rbtree3 (0.6.0)
- rdoc (6.5.0)
+ rdoc (6.6.3.1)
psych (>= 4.0.0)
regexp_parser (1.8.2)
render_csv (2.0.0)
@@ -442,7 +442,7 @@ GEM
sshkit (1.21.1)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
- stringio (3.0.5)
+ stringio (3.1.0)
temple (0.8.2)
thor (1.2.1)
tilt (2.0.10)
From ecd5387f3402f317b214a4054a8ecf7ec015ddd6 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Wed, 27 Mar 2024 12:03:10 +0100
Subject: [PATCH 132/159] Bump rack from 2.2.6.4 to 2.2.9 (#449)
Bumps [rack](https://github.com/rack/rack) from 2.2.6.4 to 2.2.9.
- [Release notes](https://github.com/rack/rack/releases)
- [Changelog](https://github.com/rack/rack/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rack/rack/compare/v2.2.6.4...v2.2.9)
---
updated-dependencies:
- dependency-name: rack
dependency-type: indirect
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
Gemfile.lock | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Gemfile.lock b/Gemfile.lock
index 2bde5313..8f9b7276 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -306,7 +306,7 @@ GEM
puma (6.3.1)
nio4r (~> 2.0)
racc (1.7.1)
- rack (2.2.6.4)
+ rack (2.2.9)
rack-test (2.1.0)
rack (>= 1.3)
rails (6.1.7.3)
From 2fe729a23dc9bee0ed441430c796a00d7f961f6c Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Wed, 27 Mar 2024 12:08:37 +0100
Subject: [PATCH 133/159] Bump rails from 6.1.7.3 to 6.1.7.7 (#445)
Bumps [rails](https://github.com/rails/rails) from 6.1.7.3 to 6.1.7.7.
- [Release notes](https://github.com/rails/rails/releases)
- [Commits](https://github.com/rails/rails/compare/v6.1.7.3...v6.1.7.7)
---
updated-dependencies:
- dependency-name: rails
dependency-type: direct:production
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
Gemfile | 2 +-
Gemfile.lock | 162 ++++++++++++++++++++++++++-------------------------
2 files changed, 83 insertions(+), 81 deletions(-)
diff --git a/Gemfile b/Gemfile
index c7b7bcf5..8a19e874 100644
--- a/Gemfile
+++ b/Gemfile
@@ -2,7 +2,7 @@
source 'https://rubygems.org'
-gem 'rails', '6.1.7.3'
+gem 'rails', '6.1.7.7'
gem 'acts_as_paranoid'
gem 'airbrake'
diff --git a/Gemfile.lock b/Gemfile.lock
index 8f9b7276..1ceb5720 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,60 +1,60 @@
GEM
remote: https://rubygems.org/
specs:
- actioncable (6.1.7.3)
- actionpack (= 6.1.7.3)
- activesupport (= 6.1.7.3)
+ actioncable (6.1.7.7)
+ actionpack (= 6.1.7.7)
+ activesupport (= 6.1.7.7)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
- actionmailbox (6.1.7.3)
- actionpack (= 6.1.7.3)
- activejob (= 6.1.7.3)
- activerecord (= 6.1.7.3)
- activestorage (= 6.1.7.3)
- activesupport (= 6.1.7.3)
+ actionmailbox (6.1.7.7)
+ actionpack (= 6.1.7.7)
+ activejob (= 6.1.7.7)
+ activerecord (= 6.1.7.7)
+ activestorage (= 6.1.7.7)
+ activesupport (= 6.1.7.7)
mail (>= 2.7.1)
- actionmailer (6.1.7.3)
- actionpack (= 6.1.7.3)
- actionview (= 6.1.7.3)
- activejob (= 6.1.7.3)
- activesupport (= 6.1.7.3)
+ actionmailer (6.1.7.7)
+ actionpack (= 6.1.7.7)
+ actionview (= 6.1.7.7)
+ activejob (= 6.1.7.7)
+ activesupport (= 6.1.7.7)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
- actionpack (6.1.7.3)
- actionview (= 6.1.7.3)
- activesupport (= 6.1.7.3)
+ actionpack (6.1.7.7)
+ actionview (= 6.1.7.7)
+ activesupport (= 6.1.7.7)
rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
- actiontext (6.1.7.3)
- actionpack (= 6.1.7.3)
- activerecord (= 6.1.7.3)
- activestorage (= 6.1.7.3)
- activesupport (= 6.1.7.3)
+ actiontext (6.1.7.7)
+ actionpack (= 6.1.7.7)
+ activerecord (= 6.1.7.7)
+ activestorage (= 6.1.7.7)
+ activesupport (= 6.1.7.7)
nokogiri (>= 1.8.5)
- actionview (6.1.7.3)
- activesupport (= 6.1.7.3)
+ actionview (6.1.7.7)
+ activesupport (= 6.1.7.7)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
- activejob (6.1.7.3)
- activesupport (= 6.1.7.3)
+ activejob (6.1.7.7)
+ activesupport (= 6.1.7.7)
globalid (>= 0.3.6)
- activemodel (6.1.7.3)
- activesupport (= 6.1.7.3)
- activerecord (6.1.7.3)
- activemodel (= 6.1.7.3)
- activesupport (= 6.1.7.3)
- activestorage (6.1.7.3)
- actionpack (= 6.1.7.3)
- activejob (= 6.1.7.3)
- activerecord (= 6.1.7.3)
- activesupport (= 6.1.7.3)
+ activemodel (6.1.7.7)
+ activesupport (= 6.1.7.7)
+ activerecord (6.1.7.7)
+ activemodel (= 6.1.7.7)
+ activesupport (= 6.1.7.7)
+ activestorage (6.1.7.7)
+ actionpack (= 6.1.7.7)
+ activejob (= 6.1.7.7)
+ activerecord (= 6.1.7.7)
+ activesupport (= 6.1.7.7)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
- activesupport (6.1.7.3)
+ activesupport (6.1.7.7)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
@@ -112,7 +112,7 @@ GEM
execjs
coffee-script-source (1.12.2)
commonjs (0.2.7)
- concurrent-ruby (1.2.2)
+ concurrent-ruby (1.2.3)
crack (0.4.4)
crass (1.0.6)
cucumber (3.2.0)
@@ -138,7 +138,7 @@ GEM
cucumber-tag_expressions (1.1.1)
cucumber-wire (0.0.1)
database_cleaner (1.8.5)
- date (3.3.3)
+ date (3.3.4)
demoji (0.0.7)
devise (4.7.3)
bcrypt (~> 3.0)
@@ -172,8 +172,8 @@ GEM
ruby2_keywords
ffi (1.15.5)
gherkin (5.1.0)
- globalid (1.1.0)
- activesupport (>= 5.0)
+ globalid (1.2.1)
+ activesupport (>= 6.1)
haml (5.2.1)
temple (>= 0.8.0)
tilt
@@ -194,7 +194,7 @@ GEM
http-cookie (1.0.3)
domain_name (~> 0.5)
http_accept_language (2.1.1)
- i18n (1.12.0)
+ i18n (1.14.4)
concurrent-ruby (~> 1.0)
i18n-js (3.8.0)
i18n (>= 0.6.6)
@@ -230,44 +230,44 @@ GEM
actionpack (>= 4)
less (~> 2.6.0)
sprockets (>= 2)
- loofah (2.19.1)
+ loofah (2.22.0)
crass (~> 1.0.2)
- nokogiri (>= 1.5.9)
+ nokogiri (>= 1.12.0)
mail (2.8.1)
mini_mime (>= 0.1.1)
net-imap
net-pop
net-smtp
- marcel (1.0.2)
+ marcel (1.0.4)
method_source (1.0.0)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2020.1104)
- mini_mime (1.1.2)
- minitest (5.18.0)
+ mini_mime (1.1.5)
+ minitest (5.22.3)
money-tree (0.11.1)
multi_json (1.15.0)
multi_test (0.1.2)
multi_xml (0.6.0)
multipart-post (2.1.1)
mysql2 (0.5.5)
- net-imap (0.3.4)
+ net-imap (0.4.10)
date
net-protocol
net-pop (0.1.2)
net-protocol
- net-protocol (0.2.1)
+ net-protocol (0.2.2)
timeout
net-scp (3.0.0)
net-ssh (>= 2.6.5, < 7.0.0)
- net-smtp (0.3.3)
+ net-smtp (0.5.0)
net-protocol
net-ssh (6.1.0)
netrc (0.11.0)
- nio4r (2.5.9)
- nokogiri (1.15.4-arm64-darwin)
+ nio4r (2.7.1)
+ nokogiri (1.16.3-arm64-darwin)
racc (~> 1.4)
- nokogiri (1.15.4-x86_64-linux)
+ nokogiri (1.16.3-x86_64-linux)
racc (~> 1.4)
oauth2 (1.4.4)
faraday (>= 0.8, < 2.0)
@@ -305,45 +305,47 @@ GEM
public_suffix (5.0.1)
puma (6.3.1)
nio4r (~> 2.0)
- racc (1.7.1)
+ racc (1.7.3)
rack (2.2.9)
rack-test (2.1.0)
rack (>= 1.3)
- rails (6.1.7.3)
- actioncable (= 6.1.7.3)
- actionmailbox (= 6.1.7.3)
- actionmailer (= 6.1.7.3)
- actionpack (= 6.1.7.3)
- actiontext (= 6.1.7.3)
- actionview (= 6.1.7.3)
- activejob (= 6.1.7.3)
- activemodel (= 6.1.7.3)
- activerecord (= 6.1.7.3)
- activestorage (= 6.1.7.3)
- activesupport (= 6.1.7.3)
+ rails (6.1.7.7)
+ actioncable (= 6.1.7.7)
+ actionmailbox (= 6.1.7.7)
+ actionmailer (= 6.1.7.7)
+ actionpack (= 6.1.7.7)
+ actiontext (= 6.1.7.7)
+ actionview (= 6.1.7.7)
+ activejob (= 6.1.7.7)
+ activemodel (= 6.1.7.7)
+ activerecord (= 6.1.7.7)
+ activestorage (= 6.1.7.7)
+ activesupport (= 6.1.7.7)
bundler (>= 1.15.0)
- railties (= 6.1.7.3)
+ railties (= 6.1.7.7)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
activesupport (>= 5.0.1.rc1)
- rails-dom-testing (2.0.3)
- activesupport (>= 4.2.0)
+ rails-dom-testing (2.2.0)
+ activesupport (>= 5.0.0)
+ minitest
nokogiri (>= 1.6)
- rails-html-sanitizer (1.5.0)
- loofah (~> 2.19, >= 2.19.1)
+ rails-html-sanitizer (1.6.0)
+ loofah (~> 2.21)
+ nokogiri (~> 1.14)
rails-i18n (7.0.6)
i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 8)
- railties (6.1.7.3)
- actionpack (= 6.1.7.3)
- activesupport (= 6.1.7.3)
+ railties (6.1.7.7)
+ actionpack (= 6.1.7.7)
+ activesupport (= 6.1.7.7)
method_source
rake (>= 12.2)
thor (~> 1.0)
rainbow (3.1.1)
- rake (13.0.6)
+ rake (13.1.0)
rbnacl (7.1.1)
ffi
rbtree3 (0.6.0)
@@ -444,9 +446,9 @@ GEM
net-ssh (>= 2.8.0)
stringio (3.1.0)
temple (0.8.2)
- thor (1.2.1)
+ thor (1.3.1)
tilt (2.0.10)
- timeout (0.3.2)
+ timeout (0.4.1)
turbolinks (5.2.1)
turbolinks-source (~> 5.2)
turbolinks-source (5.2.0)
@@ -470,12 +472,12 @@ GEM
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
- websocket-driver (0.7.5)
+ websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)
- zeitwerk (2.6.7)
+ zeitwerk (2.6.13)
PLATFORMS
arm64-darwin-22
@@ -520,7 +522,7 @@ DEPENDENCIES
pry
pry-byebug
puma
- rails (= 6.1.7.3)
+ rails (= 6.1.7.7)
rails-controller-testing
rails-i18n
rbnacl
From 624859a1422a698e25eabcc623680eaee15ea576 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Wed, 27 Mar 2024 12:15:38 +0100
Subject: [PATCH 134/159] Bump puma from 6.3.1 to 6.4.2 (#443)
Bumps [puma](https://github.com/puma/puma) from 6.3.1 to 6.4.2.
- [Release notes](https://github.com/puma/puma/releases)
- [Changelog](https://github.com/puma/puma/blob/master/History.md)
- [Commits](https://github.com/puma/puma/compare/v6.3.1...v6.4.2)
---
updated-dependencies:
- dependency-name: puma
dependency-type: direct:production
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
Gemfile.lock | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Gemfile.lock b/Gemfile.lock
index 1ceb5720..9ed34f6f 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -303,7 +303,7 @@ GEM
psych (5.1.2)
stringio
public_suffix (5.0.1)
- puma (6.3.1)
+ puma (6.4.2)
nio4r (~> 2.0)
racc (1.7.3)
rack (2.2.9)
From 6bb40a70c3312bbfa74536dafbb3abac371b2af7 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Tue, 10 Oct 2023 23:49:35 +0200
Subject: [PATCH 135/159] updated deploy config
---
config/deploy/production.rb | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/config/deploy/production.rb b/config/deploy/production.rb
index 13bcd143..714353d5 100644
--- a/config/deploy/production.rb
+++ b/config/deploy/production.rb
@@ -7,9 +7,9 @@
# Supports bulk-adding hosts to roles, the primary
# server in each group is considered to be the first
# unless any hosts have the primary property set.
-role :app, %w[apps@50.116.2.58]
-role :web, %w[apps@50.116.2.58]
-role :db, %w[apps@50.116.2.58]
+role :app, %w[apps@tip4commit]
+role :web, %w[apps@tip4commit]
+role :db, %w[apps@tip4commit]
set :rails_env, 'production'
set :migration_role, 'db'
From 2b0aeb1517a58f2ed49240f5397c8dad8b72f363 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Tue, 10 Oct 2023 23:50:43 +0200
Subject: [PATCH 136/159] Do not try to send tips with bitcoin rpc
---
lib/bitcoin_tipper.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/bitcoin_tipper.rb b/lib/bitcoin_tipper.rb
index 10506a6c..93010c30 100644
--- a/lib/bitcoin_tipper.rb
+++ b/lib/bitcoin_tipper.rb
@@ -31,8 +31,8 @@ def check_and_withdrawal_funds
# self.create_sendmany
# end
- Rails.logger.info 'Traversing sendmanies...'
- Sendmany.where(txid: nil).each(&:send_transaction)
+ # Rails.logger.info 'Traversing sendmanies...'
+ # Sendmany.where(txid: nil).each(&:send_transaction)
end
def auto_decide_older_tips
From 35c175030d42e2c85f53671000686f4cb23cb11b Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Tue, 10 Oct 2023 23:51:05 +0200
Subject: [PATCH 137/159] Fixed sendmany creation
---
lib/bitcoin_tipper.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/bitcoin_tipper.rb b/lib/bitcoin_tipper.rb
index 93010c30..1cdde599 100644
--- a/lib/bitcoin_tipper.rb
+++ b/lib/bitcoin_tipper.rb
@@ -76,13 +76,13 @@ def create_sendmany
Rails.logger.info 'Creating sendmany'
ActiveRecord::Base.transaction do
sendmany = Sendmany.create
- outs = calculate_outputs
+ outs = calculate_outputs(sendmany)
sendmany.update_attribute :data, outs.to_json
Rails.logger.info " #{sendmany.inspect}"
end
end
- def calculate_outputs
+ def calculate_outputs(sendmany)
outputs = {}
User.find_each do |user|
next unless user.ready_for_withdrawal?
From 51f278659f63eb6e2b5cb26d0e10369a1c922e0f Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Tue, 5 Nov 2024 10:48:19 +0100
Subject: [PATCH 138/159] Updated rails
---
Gemfile | 2 +-
Gemfile.lock | 112 +++++++++++++++++++++++++--------------------------
2 files changed, 57 insertions(+), 57 deletions(-)
diff --git a/Gemfile b/Gemfile
index 8a19e874..238fb2f7 100644
--- a/Gemfile
+++ b/Gemfile
@@ -2,7 +2,7 @@
source 'https://rubygems.org'
-gem 'rails', '6.1.7.7'
+gem 'rails', '6.1.7.10'
gem 'acts_as_paranoid'
gem 'airbrake'
diff --git a/Gemfile.lock b/Gemfile.lock
index 9ed34f6f..09b8e3fa 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,60 +1,60 @@
GEM
remote: https://rubygems.org/
specs:
- actioncable (6.1.7.7)
- actionpack (= 6.1.7.7)
- activesupport (= 6.1.7.7)
+ actioncable (6.1.7.10)
+ actionpack (= 6.1.7.10)
+ activesupport (= 6.1.7.10)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
- actionmailbox (6.1.7.7)
- actionpack (= 6.1.7.7)
- activejob (= 6.1.7.7)
- activerecord (= 6.1.7.7)
- activestorage (= 6.1.7.7)
- activesupport (= 6.1.7.7)
+ actionmailbox (6.1.7.10)
+ actionpack (= 6.1.7.10)
+ activejob (= 6.1.7.10)
+ activerecord (= 6.1.7.10)
+ activestorage (= 6.1.7.10)
+ activesupport (= 6.1.7.10)
mail (>= 2.7.1)
- actionmailer (6.1.7.7)
- actionpack (= 6.1.7.7)
- actionview (= 6.1.7.7)
- activejob (= 6.1.7.7)
- activesupport (= 6.1.7.7)
+ actionmailer (6.1.7.10)
+ actionpack (= 6.1.7.10)
+ actionview (= 6.1.7.10)
+ activejob (= 6.1.7.10)
+ activesupport (= 6.1.7.10)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
- actionpack (6.1.7.7)
- actionview (= 6.1.7.7)
- activesupport (= 6.1.7.7)
+ actionpack (6.1.7.10)
+ actionview (= 6.1.7.10)
+ activesupport (= 6.1.7.10)
rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
- actiontext (6.1.7.7)
- actionpack (= 6.1.7.7)
- activerecord (= 6.1.7.7)
- activestorage (= 6.1.7.7)
- activesupport (= 6.1.7.7)
+ actiontext (6.1.7.10)
+ actionpack (= 6.1.7.10)
+ activerecord (= 6.1.7.10)
+ activestorage (= 6.1.7.10)
+ activesupport (= 6.1.7.10)
nokogiri (>= 1.8.5)
- actionview (6.1.7.7)
- activesupport (= 6.1.7.7)
+ actionview (6.1.7.10)
+ activesupport (= 6.1.7.10)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
- activejob (6.1.7.7)
- activesupport (= 6.1.7.7)
+ activejob (6.1.7.10)
+ activesupport (= 6.1.7.10)
globalid (>= 0.3.6)
- activemodel (6.1.7.7)
- activesupport (= 6.1.7.7)
- activerecord (6.1.7.7)
- activemodel (= 6.1.7.7)
- activesupport (= 6.1.7.7)
- activestorage (6.1.7.7)
- actionpack (= 6.1.7.7)
- activejob (= 6.1.7.7)
- activerecord (= 6.1.7.7)
- activesupport (= 6.1.7.7)
+ activemodel (6.1.7.10)
+ activesupport (= 6.1.7.10)
+ activerecord (6.1.7.10)
+ activemodel (= 6.1.7.10)
+ activesupport (= 6.1.7.10)
+ activestorage (6.1.7.10)
+ actionpack (= 6.1.7.10)
+ activejob (= 6.1.7.10)
+ activerecord (= 6.1.7.10)
+ activesupport (= 6.1.7.10)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
- activesupport (6.1.7.7)
+ activesupport (6.1.7.10)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
@@ -138,7 +138,7 @@ GEM
cucumber-tag_expressions (1.1.1)
cucumber-wire (0.0.1)
database_cleaner (1.8.5)
- date (3.3.4)
+ date (3.4.0)
demoji (0.0.7)
devise (4.7.3)
bcrypt (~> 3.0)
@@ -251,7 +251,7 @@ GEM
multi_xml (0.6.0)
multipart-post (2.1.1)
mysql2 (0.5.5)
- net-imap (0.4.10)
+ net-imap (0.4.17)
date
net-protocol
net-pop (0.1.2)
@@ -309,20 +309,20 @@ GEM
rack (2.2.9)
rack-test (2.1.0)
rack (>= 1.3)
- rails (6.1.7.7)
- actioncable (= 6.1.7.7)
- actionmailbox (= 6.1.7.7)
- actionmailer (= 6.1.7.7)
- actionpack (= 6.1.7.7)
- actiontext (= 6.1.7.7)
- actionview (= 6.1.7.7)
- activejob (= 6.1.7.7)
- activemodel (= 6.1.7.7)
- activerecord (= 6.1.7.7)
- activestorage (= 6.1.7.7)
- activesupport (= 6.1.7.7)
+ rails (6.1.7.10)
+ actioncable (= 6.1.7.10)
+ actionmailbox (= 6.1.7.10)
+ actionmailer (= 6.1.7.10)
+ actionpack (= 6.1.7.10)
+ actiontext (= 6.1.7.10)
+ actionview (= 6.1.7.10)
+ activejob (= 6.1.7.10)
+ activemodel (= 6.1.7.10)
+ activerecord (= 6.1.7.10)
+ activestorage (= 6.1.7.10)
+ activesupport (= 6.1.7.10)
bundler (>= 1.15.0)
- railties (= 6.1.7.7)
+ railties (= 6.1.7.10)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
@@ -338,9 +338,9 @@ GEM
rails-i18n (7.0.6)
i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 8)
- railties (6.1.7.7)
- actionpack (= 6.1.7.7)
- activesupport (= 6.1.7.7)
+ railties (6.1.7.10)
+ actionpack (= 6.1.7.10)
+ activesupport (= 6.1.7.10)
method_source
rake (>= 12.2)
thor (~> 1.0)
@@ -522,7 +522,7 @@ DEPENDENCIES
pry
pry-byebug
puma
- rails (= 6.1.7.7)
+ rails (= 6.1.7.10)
rails-controller-testing
rails-i18n
rbnacl
From 8fa6cfc5ff2f481f8be926416eab73d4c9e27ba3 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Tue, 5 Nov 2024 11:14:29 +0100
Subject: [PATCH 139/159] Updated ruby to 3.2.6
---
.github/workflows/build.yml | 4 +---
.tool-versions | 2 +-
Gemfile | 3 ++-
Gemfile.lock | 47 +++++++++++++++++--------------------
config/deploy.rb | 2 +-
5 files changed, 26 insertions(+), 32 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 9d9cc828..db179f52 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -12,9 +12,7 @@ jobs:
strategy:
matrix:
ruby-version:
- - 3.0.5
- # - 3.1.3
- # - 3.2.1
+ - 3.2.6
fail-fast: false
steps:
diff --git a/.tool-versions b/.tool-versions
index 5de817ed..a1e3a5ab 100644
--- a/.tool-versions
+++ b/.tool-versions
@@ -1 +1 @@
-ruby 3.0.5
+ruby 3.2.6
diff --git a/Gemfile b/Gemfile
index 238fb2f7..b421ef4a 100644
--- a/Gemfile
+++ b/Gemfile
@@ -62,12 +62,13 @@ group :development, :test do
gem 'rubocop'
gem 'rubocop-rails'
gem 'rubocop-rspec'
- gem 'sqlite3'
+ gem 'sqlite3', '~> 1.4'
end
group :test do
gem 'cucumber-rails', '~> 1.0', require: false
gem 'database_cleaner'
+ gem 'matrix'
gem 'rails-controller-testing'
gem 'rspec-activemodel-mocks'
gem 'shoulda-matchers'
diff --git a/Gemfile.lock b/Gemfile.lock
index 09b8e3fa..364eab33 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -65,10 +65,10 @@ GEM
activesupport (>= 5.2, < 7.0)
addressable (2.8.1)
public_suffix (>= 2.0.2, < 6.0)
- airbrake (11.0.1)
- airbrake-ruby (~> 5.1)
- airbrake-ruby (5.2.0)
- rbtree3 (~> 0.5)
+ airbrake (13.0.4)
+ airbrake-ruby (~> 6.0)
+ airbrake-ruby (6.2.2)
+ rbtree3 (~> 0.6)
airbrussh (1.4.0)
sshkit (>= 1.6.1, != 1.7.0)
ast (2.4.2)
@@ -149,7 +149,7 @@ GEM
devise-i18n (1.9.2)
devise (>= 4.7.1)
diff-lcs (1.4.4)
- docile (1.3.2)
+ docile (1.4.1)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
dusen (0.6.1)
@@ -160,7 +160,6 @@ GEM
edge_rider (1.1.0)
activerecord (>= 3.2)
erubi (1.12.0)
- erubis (2.7.0)
execjs (2.7.0)
factory_bot (6.1.0)
activesupport (>= 5.0.0)
@@ -170,26 +169,21 @@ GEM
faraday (1.1.0)
multipart-post (>= 1.2, < 3)
ruby2_keywords
- ffi (1.15.5)
+ ffi (1.17.0-arm64-darwin)
+ ffi (1.17.0-x86_64-linux-gnu)
gherkin (5.1.0)
globalid (1.2.1)
activesupport (>= 6.1)
haml (5.2.1)
temple (>= 0.8.0)
tilt
- haml-rails (2.0.1)
+ haml-rails (2.1.0)
actionpack (>= 5.1)
activesupport (>= 5.1)
- haml (>= 4.0.6, < 6.0)
- html2haml (>= 1.0.1)
+ haml (>= 4.0.6)
railties (>= 5.1)
hashdiff (1.0.1)
hashie (4.1.0)
- html2haml (2.2.0)
- erubis (~> 2.7.0)
- haml (>= 4.0, < 6)
- nokogiri (>= 1.6.0)
- ruby_parser (~> 3.5)
http-accept (1.7.0)
http-cookie (1.0.3)
domain_name (~> 0.5)
@@ -239,6 +233,7 @@ GEM
net-pop
net-smtp
marcel (1.0.4)
+ matrix (0.4.2)
method_source (1.0.0)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
@@ -346,9 +341,9 @@ GEM
thor (~> 1.0)
rainbow (3.1.1)
rake (13.1.0)
- rbnacl (7.1.1)
- ffi
- rbtree3 (0.6.0)
+ rbnacl (7.1.2)
+ ffi (~> 1)
+ rbtree3 (0.7.1)
rdoc (6.6.3.1)
psych (>= 4.0.0)
regexp_parser (1.8.2)
@@ -407,8 +402,6 @@ GEM
rubocop-capybara (~> 2.17)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.2)
- ruby_parser (3.15.0)
- sexp_processor (~> 4.9)
sass-rails (6.0.0)
sassc-rails (~> 2.1, >= 2.1.1)
sassc (2.4.0)
@@ -424,15 +417,14 @@ GEM
faraday (> 0.8, < 2.0)
sdoc (2.0.2)
rdoc (>= 5.0)
- sexp_processor (4.15.1)
shoulda-matchers (4.4.1)
activesupport (>= 4.2.0)
- simplecov (0.20.0)
+ simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
- simplecov-html (0.12.3)
- simplecov_json_formatter (0.1.2)
+ simplecov-html (0.13.1)
+ simplecov_json_formatter (0.1.4)
sprockets (4.2.0)
concurrent-ruby (~> 1.0)
rack (>= 2.2.4, < 4)
@@ -440,7 +432,8 @@ GEM
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
- sqlite3 (1.4.2)
+ sqlite3 (1.7.3-arm64-darwin)
+ sqlite3 (1.7.3-x86_64-linux)
sshkit (1.21.1)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
@@ -481,6 +474,7 @@ GEM
PLATFORMS
arm64-darwin-22
+ arm64-darwin-24
x86_64-linux
DEPENDENCIES
@@ -513,6 +507,7 @@ DEPENDENCIES
jquery-turbolinks
kaminari
kaminari-i18n
+ matrix
money-tree
mysql2
octokit
@@ -539,7 +534,7 @@ DEPENDENCIES
shoulda-matchers
simplecov
sprockets
- sqlite3
+ sqlite3 (~> 1.4)
turbolinks
twitter-bootstrap-rails
uglifier
diff --git a/config/deploy.rb b/config/deploy.rb
index a54b741f..8b639376 100644
--- a/config/deploy.rb
+++ b/config/deploy.rb
@@ -8,7 +8,7 @@
set :deploy_to, '/home/apps/t4c'
set :rvm_type, :user
-set :rvm_ruby_version, '3.0.5'
+set :rvm_ruby_version, '3.2.6'
set :rvm_custom_path, '~/.rvm'
set :format, :pretty
From 398a1c17235f6756728197f23bf437b8b2e9edab Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Tue, 5 Nov 2024 11:16:43 +0100
Subject: [PATCH 140/159] Updated cucumber
---
Gemfile | 1 -
Gemfile.lock | 56 +++++++++++++++++++++++++++-------------------------
2 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/Gemfile b/Gemfile
index b421ef4a..63b9a325 100644
--- a/Gemfile
+++ b/Gemfile
@@ -68,7 +68,6 @@ end
group :test do
gem 'cucumber-rails', '~> 1.0', require: false
gem 'database_cleaner'
- gem 'matrix'
gem 'rails-controller-testing'
gem 'rspec-activemodel-mocks'
gem 'shoulda-matchers'
diff --git a/Gemfile.lock b/Gemfile.lock
index 364eab33..d785027e 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -63,8 +63,8 @@ GEM
acts_as_paranoid (0.7.0)
activerecord (>= 5.2, < 7.0)
activesupport (>= 5.2, < 7.0)
- addressable (2.8.1)
- public_suffix (>= 2.0.2, < 6.0)
+ addressable (2.8.7)
+ public_suffix (>= 2.0.2, < 7.0)
airbrake (13.0.4)
airbrake-ruby (~> 6.0)
airbrake-ruby (6.2.2)
@@ -72,14 +72,14 @@ GEM
airbrussh (1.4.0)
sshkit (>= 1.6.1, != 1.7.0)
ast (2.4.2)
- backports (3.18.2)
+ backports (3.25.0)
bcrypt (3.1.16)
bcrypt_pbkdf (1.0.1)
bech32 (1.0.5)
bootstrap_form (4.5.0)
actionpack (>= 5.2)
activemodel (>= 5.2)
- builder (3.2.4)
+ builder (3.3.0)
byebug (11.1.3)
cancancan (3.1.0)
capistrano (3.14.1)
@@ -95,13 +95,14 @@ GEM
capistrano-rvm (0.1.2)
capistrano (~> 3.0)
sshkit (~> 1.2)
- capybara (3.34.0)
+ capybara (3.40.0)
addressable
+ matrix
mini_mime (>= 0.1.3)
- nokogiri (~> 1.8)
+ nokogiri (~> 1.11)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
- regexp_parser (~> 1.5)
+ regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
coderay (1.1.3)
coffee-rails (5.0.0)
@@ -112,7 +113,7 @@ GEM
execjs
coffee-script-source (1.12.2)
commonjs (0.2.7)
- concurrent-ruby (1.2.3)
+ concurrent-ruby (1.3.4)
crack (0.4.4)
crass (1.0.6)
cucumber (3.2.0)
@@ -148,7 +149,7 @@ GEM
warden (~> 1.2.3)
devise-i18n (1.9.2)
devise (>= 4.7.1)
- diff-lcs (1.4.4)
+ diff-lcs (1.5.1)
docile (1.4.1)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
@@ -159,7 +160,7 @@ GEM
ed25519 (1.2.4)
edge_rider (1.1.0)
activerecord (>= 3.2)
- erubi (1.12.0)
+ erubi (1.13.0)
execjs (2.7.0)
factory_bot (6.1.0)
activesupport (>= 5.0.0)
@@ -188,7 +189,7 @@ GEM
http-cookie (1.0.3)
domain_name (~> 0.5)
http_accept_language (2.1.1)
- i18n (1.14.4)
+ i18n (1.14.6)
concurrent-ruby (~> 1.0)
i18n-js (3.8.0)
i18n (>= 0.6.6)
@@ -224,7 +225,8 @@ GEM
actionpack (>= 4)
less (~> 2.6.0)
sprockets (>= 2)
- loofah (2.22.0)
+ logger (1.6.1)
+ loofah (2.23.1)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
mail (2.8.1)
@@ -234,15 +236,16 @@ GEM
net-smtp
marcel (1.0.4)
matrix (0.4.2)
- method_source (1.0.0)
- mime-types (3.3.1)
+ method_source (1.1.0)
+ mime-types (3.6.0)
+ logger
mime-types-data (~> 3.2015)
- mime-types-data (3.2020.1104)
+ mime-types-data (3.2024.1001)
mini_mime (1.1.5)
- minitest (5.22.3)
+ minitest (5.25.1)
money-tree (0.11.1)
multi_json (1.15.0)
- multi_test (0.1.2)
+ multi_test (1.1.0)
multi_xml (0.6.0)
multipart-post (2.1.1)
mysql2 (0.5.5)
@@ -260,9 +263,9 @@ GEM
net-ssh (6.1.0)
netrc (0.11.0)
nio4r (2.7.1)
- nokogiri (1.16.3-arm64-darwin)
+ nokogiri (1.16.7-arm64-darwin)
racc (~> 1.4)
- nokogiri (1.16.3-x86_64-linux)
+ nokogiri (1.16.7-x86_64-linux)
racc (~> 1.4)
oauth2 (1.4.4)
faraday (>= 0.8, < 2.0)
@@ -297,11 +300,11 @@ GEM
pry (>= 0.13, < 0.15)
psych (5.1.2)
stringio
- public_suffix (5.0.1)
+ public_suffix (6.0.1)
puma (6.4.2)
nio4r (~> 2.0)
- racc (1.7.3)
- rack (2.2.9)
+ racc (1.8.1)
+ rack (2.2.10)
rack-test (2.1.0)
rack (>= 1.3)
rails (6.1.7.10)
@@ -340,13 +343,13 @@ GEM
rake (>= 12.2)
thor (~> 1.0)
rainbow (3.1.1)
- rake (13.1.0)
+ rake (13.2.1)
rbnacl (7.1.2)
ffi (~> 1)
rbtree3 (0.7.1)
rdoc (6.6.3.1)
psych (>= 4.0.0)
- regexp_parser (1.8.2)
+ regexp_parser (2.9.2)
render_csv (2.0.0)
rails (>= 3.0)
responders (3.0.1)
@@ -439,7 +442,7 @@ GEM
net-ssh (>= 2.8.0)
stringio (3.1.0)
temple (0.8.2)
- thor (1.3.1)
+ thor (1.3.2)
tilt (2.0.10)
timeout (0.4.1)
turbolinks (5.2.1)
@@ -470,7 +473,7 @@ GEM
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)
- zeitwerk (2.6.13)
+ zeitwerk (2.7.1)
PLATFORMS
arm64-darwin-22
@@ -507,7 +510,6 @@ DEPENDENCIES
jquery-turbolinks
kaminari
kaminari-i18n
- matrix
money-tree
mysql2
octokit
From 2f3a6022e5240cfdef68ba83102e23bbb78d4118 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Tue, 5 Nov 2024 11:25:21 +0100
Subject: [PATCH 141/159] enable OpenSSL legacy provider for compatibility in
GitHub Actions
---
.github/workflows/build.yml | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index db179f52..a0c7e8d5 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -25,6 +25,12 @@ jobs:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
+ - name: Configure OpenSSL
+ run: |
+ sudo sed -i '/\[provider_sect\]/a legacy = legacy_sect' /etc/ssl/openssl.cnf
+ sudo sed -i '/\[default_sect\]/a activate = 1' /etc/ssl/openssl.cnf
+ echo -e '\n[legacy_sect]\nactivate = 1' | sudo tee -a /etc/ssl/openssl.cnf
+
- name: Install dependencies
run: |
bundle config set without 'development'
From 2af9e390e99cc4aba14d657d4bd2c7334e52e752 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Tue, 5 Nov 2024 11:27:15 +0100
Subject: [PATCH 142/159] Check openssl version in ci
---
.github/workflows/build.yml | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index a0c7e8d5..c8d2d26e 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -25,11 +25,8 @@ jobs:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- - name: Configure OpenSSL
- run: |
- sudo sed -i '/\[provider_sect\]/a legacy = legacy_sect' /etc/ssl/openssl.cnf
- sudo sed -i '/\[default_sect\]/a activate = 1' /etc/ssl/openssl.cnf
- echo -e '\n[legacy_sect]\nactivate = 1' | sudo tee -a /etc/ssl/openssl.cnf
+ - name: Check OpenSSL Version
+ run: openssl version
- name: Install dependencies
run: |
From d52a3de5e320f37c3343f675fd0dfc6df3ec23fa Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Tue, 5 Nov 2024 11:34:05 +0100
Subject: [PATCH 143/159] Updated money-tree
---
Gemfile.lock | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/Gemfile.lock b/Gemfile.lock
index d785027e..fa8f1ed8 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -75,7 +75,8 @@ GEM
backports (3.25.0)
bcrypt (3.1.16)
bcrypt_pbkdf (1.0.1)
- bech32 (1.0.5)
+ bech32 (1.4.2)
+ thor (>= 1.1.0)
bootstrap_form (4.5.0)
actionpack (>= 5.2)
activemodel (>= 5.2)
@@ -243,7 +244,9 @@ GEM
mime-types-data (3.2024.1001)
mini_mime (1.1.5)
minitest (5.25.1)
- money-tree (0.11.1)
+ money-tree (0.11.2)
+ bech32 (~> 1.3)
+ openssl (~> 3.1)
multi_json (1.15.0)
multi_test (1.1.0)
multi_xml (0.6.0)
@@ -288,6 +291,7 @@ GEM
omniauth-rails_csrf_protection (0.1.2)
actionpack (>= 4.2)
omniauth (>= 1.3.1)
+ openssl (3.2.0)
orm_adapter (0.5.0)
parallel (1.22.1)
parser (3.2.1.1)
From 31ca89c3d00bd62d6cec9f01a68ffddbdb05db5f Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Tue, 5 Nov 2024 11:44:28 +0100
Subject: [PATCH 144/159] Updated rubocop target ruby version
---
.rubocop.yml | 2 +-
app/models/project.rb | 4 ++--
app/models/user.rb | 4 ++--
features/step_definitions/users_steps.rb | 4 ++--
lib/blacklist.rb | 2 --
5 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/.rubocop.yml b/.rubocop.yml
index 5eee973d..c0f62e3f 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -6,7 +6,7 @@ require:
- rubocop-rspec
AllCops:
- TargetRubyVersion: 3.0
+ TargetRubyVersion: 3.2
NewCops: enable
Exclude:
- 'db/schema.rb'
diff --git a/app/models/project.rb b/app/models/project.rb
index 8b2effb0..70d72905 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -138,8 +138,8 @@ def tip_for(commit)
# create a tip
tip = tips.create(
- user: user,
- amount: amount,
+ user:,
+ amount:,
commit: commit.sha,
commit_message: commit.commit.message
)
diff --git a/app/models/user.rb b/app/models/user.rb
index f4ed033c..563b468b 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -77,7 +77,7 @@ def find_by_commit(commit)
email = commit.commit.author.email
nickname = commit.author.try(:login)
- find_by(email: email) || (nickname.blank? ? nil : find_by(nickname: nickname))
+ find_by(email:) || (nickname.blank? ? nil : find_by(nickname:))
end
def find_by_nickname(nickname)
@@ -94,7 +94,7 @@ def gravatar
def set_login_token!
loop do
self.login_token = SecureRandom.urlsafe_base64
- break login_token unless User.exists?(login_token: login_token)
+ break login_token unless User.exists?(login_token:)
end
end
end
diff --git a/features/step_definitions/users_steps.rb b/features/step_definitions/users_steps.rb
index 7984b949..9dffcff0 100644
--- a/features/step_definitions/users_steps.rb
+++ b/features/step_definitions/users_steps.rb
@@ -17,9 +17,9 @@ def create_user(nickname, has_bitcoiin_address)
end
Then(/^a developer named "(.*?)" does not exist$/) do |nickname|
- User.where(nickname: nickname).first.should be_nil
+ User.where(nickname:).first.should be_nil
end
Then(/^a developer named "(.*?)" exists$/) do |nickname|
- User.where(nickname: nickname).first.should_not be_nil
+ User.where(nickname:).first.should_not be_nil
end
diff --git a/lib/blacklist.rb b/lib/blacklist.rb
index d30d5a75..2fa2733b 100644
--- a/lib/blacklist.rb
+++ b/lib/blacklist.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'set'
-
class Blacklist
def initialize(urls)
urls = urls.map { |u| normalize_url(u) }
From 536142dd0932e7d3b88cc87780b98dcb97cfe909 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Tue, 5 Nov 2024 11:44:44 +0100
Subject: [PATCH 145/159] Update build workflow to remove OpenSSL version check
---
.github/workflows/build.yml | 3 ---
1 file changed, 3 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index c8d2d26e..db179f52 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -25,9 +25,6 @@ jobs:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- - name: Check OpenSSL Version
- run: openssl version
-
- name: Install dependencies
run: |
bundle config set without 'development'
From a8404d846b98c025dbc958dac8778e754c09455a Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Tue, 5 Nov 2024 11:57:51 +0100
Subject: [PATCH 146/159] Try to install openssl 1.1
---
.github/workflows/build.yml | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index db179f52..ac234187 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -19,6 +19,14 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2
+ - name: Install OpenSSL 1.1
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y libssl1.1 libssl-dev
+
+ - name: Set RUBY_CONFIGURE_OPTS
+ run: echo "RUBY_CONFIGURE_OPTS=--with-openssl-dir=/usr/lib/ssl" >> $GITHUB_ENV
+
- name: Set up Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@v1
with:
From a684d274d1aaa50dd91127136c534cb4ca7fe4d4 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Tue, 5 Nov 2024 11:59:41 +0100
Subject: [PATCH 147/159] Revert "Try to install openssl 1.1"
This reverts commit a8404d846b98c025dbc958dac8778e754c09455a.
---
.github/workflows/build.yml | 8 --------
1 file changed, 8 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index ac234187..db179f52 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -19,14 +19,6 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2
- - name: Install OpenSSL 1.1
- run: |
- sudo apt-get update
- sudo apt-get install -y libssl1.1 libssl-dev
-
- - name: Set RUBY_CONFIGURE_OPTS
- run: echo "RUBY_CONFIGURE_OPTS=--with-openssl-dir=/usr/lib/ssl" >> $GITHUB_ENV
-
- name: Set up Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@v1
with:
From b18db00ca3a4c2e66e6d10b6fc9c4a3edb90dbdf Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Tue, 5 Nov 2024 12:05:46 +0100
Subject: [PATCH 148/159] Try to load OpenSSL ripemd160
---
.github/workflows/build.yml | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index db179f52..f7c61b08 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -25,6 +25,13 @@ jobs:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
+ - name: Load OpenSSL ripemd160
+ run: |
+ sed -i '/^\default = default_sect/a legacy = legacy_sect' /etc/ssl/openssl.cnf
+ sed -i '/^\[default_sect\]/a activate = 1' /etc/ssl/openssl.cnf
+ echo "[legacy_sect]" >> /etc/ssl/openssl.cnf
+ echo "activate = 1" >> /etc/ssl/openssl.cnf
+
- name: Install dependencies
run: |
bundle config set without 'development'
From 64288cd27e5df470919c38d25ff971ccf301e8e4 Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Tue, 5 Nov 2024 12:08:07 +0100
Subject: [PATCH 149/159] Updated fix
---
.github/workflows/build.yml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index f7c61b08..ae218b40 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -27,10 +27,10 @@ jobs:
- name: Load OpenSSL ripemd160
run: |
- sed -i '/^\default = default_sect/a legacy = legacy_sect' /etc/ssl/openssl.cnf
- sed -i '/^\[default_sect\]/a activate = 1' /etc/ssl/openssl.cnf
- echo "[legacy_sect]" >> /etc/ssl/openssl.cnf
- echo "activate = 1" >> /etc/ssl/openssl.cnf
+ sudo sed -i '/^\default = default_sect/a legacy = legacy_sect' /etc/ssl/openssl.cnf
+ sudo sed -i '/^\[default_sect\]/a activate = 1' /etc/ssl/openssl.cnf
+ echo "[legacy_sect]" | sudo tee -a /etc/ssl/openssl.cnf
+ echo "activate = 1" | sudo tee -a /etc/ssl/openssl.cnf
- name: Install dependencies
run: |
From 9839e31a3438085de4b3af9d5ff70fda726119aa Mon Sep 17 00:00:00 2001
From: Aleksandr Zykov
Date: Tue, 5 Nov 2024 12:09:53 +0100
Subject: [PATCH 150/159] Try to use ubuntu-24.04
---
.github/workflows/build.yml | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index ae218b40..ef41bee5 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -8,7 +8,7 @@ on:
jobs:
build:
- runs-on: ubuntu-latest
+ runs-on: ubuntu-24.04
strategy:
matrix:
ruby-version:
@@ -25,13 +25,6 @@ jobs:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- - name: Load OpenSSL ripemd160
- run: |
- sudo sed -i '/^\default = default_sect/a legacy = legacy_sect' /etc/ssl/openssl.cnf
- sudo sed -i '/^\[default_sect\]/a activate = 1' /etc/ssl/openssl.cnf
- echo "[legacy_sect]" | sudo tee -a /etc/ssl/openssl.cnf
- echo "activate = 1" | sudo tee -a /etc/ssl/openssl.cnf
-
- name: Install dependencies
run: |
bundle config set without 'development'
From ef9494e64f25161d1a8bf24736786e9f677f43a3 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 5 Nov 2024 12:44:30 +0100
Subject: [PATCH 151/159] Bump rexml from 3.2.5 to 3.3.9 (#454)
Bumps [rexml](https://github.com/ruby/rexml) from 3.2.5 to 3.3.9.
- [Release notes](https://github.com/ruby/rexml/releases)
- [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md)
- [Commits](https://github.com/ruby/rexml/compare/v3.2.5...v3.3.9)
---
updated-dependencies:
- dependency-name: rexml
dependency-type: indirect
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
Gemfile.lock | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Gemfile.lock b/Gemfile.lock
index fa8f1ed8..909031d3 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -364,7 +364,7 @@ GEM
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
- rexml (3.2.5)
+ rexml (3.3.9)
rspec-activemodel-mocks (1.1.0)
activemodel (>= 3.0)
activesupport (>= 3.0)
From 438c21951af3a9a79606667479ea83f1f7e29152 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 5 Nov 2024 12:51:36 +0100
Subject: [PATCH 152/159] Bump puma from 6.4.2 to 6.4.3 (#455)
Bumps [puma](https://github.com/puma/puma) from 6.4.2 to 6.4.3.
- [Release notes](https://github.com/puma/puma/releases)
- [Changelog](https://github.com/puma/puma/blob/master/History.md)
- [Commits](https://github.com/puma/puma/compare/v6.4.2...v6.4.3)
---
updated-dependencies:
- dependency-name: puma
dependency-type: direct:production
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
Gemfile.lock | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Gemfile.lock b/Gemfile.lock
index 909031d3..ea628fb1 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -265,7 +265,7 @@ GEM
net-protocol
net-ssh (6.1.0)
netrc (0.11.0)
- nio4r (2.7.1)
+ nio4r (2.7.4)
nokogiri (1.16.7-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.7-x86_64-linux)
@@ -305,7 +305,7 @@ GEM
psych (5.1.2)
stringio
public_suffix (6.0.1)
- puma (6.4.2)
+ puma (6.4.3)
nio4r (~> 2.0)
racc (1.8.1)
rack (2.2.10)
From b54a23471ff61af306e6a765daa2f4d835016c78 Mon Sep 17 00:00:00 2001
From: Humz
Date: Tue, 5 Nov 2024 12:00:29 +0000
Subject: [PATCH 153/159] Update de.yml (#409)
Localisation improved as in German syntax rules, nouns are in capitals
---
config/locales/de.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/locales/de.yml b/config/locales/de.yml
index b2ea2e77..c8f0cef6 100644
--- a/config/locales/de.yml
+++ b/config/locales/de.yml
@@ -2,7 +2,7 @@ de:
tip4commit: Tip4Commit
meta:
title: Tragen Sie zu Open-Source-Projekten bei
- description: Spenden Sie bitcoins an Projekte die Sie interessieren oder fügen Sie commits hinzu um Trinkgelder zu erhalten
+ description: Spenden Sie Bitcoins an Projekte die Sie interessieren oder fügen Sie Commits hinzu um Trinkgelder zu erhalten
menu:
home: Home
projects: Unterstützte Projekte
From 32dea6b2d397582305fd156372b18d85d49b4e12 Mon Sep 17 00:00:00 2001
From: bashgnu <38274202+bashgnu@users.noreply.github.com>
Date: Tue, 5 Nov 2024 20:00:46 +0800
Subject: [PATCH 154/159] Update en.yml (#407)
---
config/locales/en.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 969ae7ff..171a69a1 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -233,6 +233,6 @@ en:
general:
or: or
disclaimer:
- line1: "Tip4Commit is not affiliated with most of the projects."
+ line1: "Tip4Commit is not affiliated with most of these projects."
line2: "There is no guarantee that tips will be claimed by developers."
line3: "By donating the funds you agree that they can be sent to the Free Software Foundation or elsewhere at Tip4Commit's discretion."
From 10db9fa223dbfc3a0d1ccbb5031a80b59757f3c6 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 17 Dec 2024 21:04:16 +0100
Subject: [PATCH 155/159] Bump rails-html-sanitizer from 1.6.0 to 1.6.1 (#457)
Bumps [rails-html-sanitizer](https://github.com/rails/rails-html-sanitizer) from 1.6.0 to 1.6.1.
- [Release notes](https://github.com/rails/rails-html-sanitizer/releases)
- [Changelog](https://github.com/rails/rails-html-sanitizer/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rails/rails-html-sanitizer/compare/v1.6.0...v1.6.1)
---
updated-dependencies:
- dependency-name: rails-html-sanitizer
dependency-type: indirect
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
Gemfile.lock | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/Gemfile.lock b/Gemfile.lock
index ea628fb1..28262ed0 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -266,9 +266,9 @@ GEM
net-ssh (6.1.0)
netrc (0.11.0)
nio4r (2.7.4)
- nokogiri (1.16.7-arm64-darwin)
+ nokogiri (1.16.8-arm64-darwin)
racc (~> 1.4)
- nokogiri (1.16.7-x86_64-linux)
+ nokogiri (1.16.8-x86_64-linux)
racc (~> 1.4)
oauth2 (1.4.4)
faraday (>= 0.8, < 2.0)
@@ -334,9 +334,9 @@ GEM
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
- rails-html-sanitizer (1.6.0)
+ rails-html-sanitizer (1.6.1)
loofah (~> 2.21)
- nokogiri (~> 1.14)
+ nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
rails-i18n (7.0.6)
i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 8)
From 517c1999364193cec96606949ba1e1ef2655dee4 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 9 May 2025 08:30:51 +0200
Subject: [PATCH 156/159] Bump rack from 2.2.10 to 2.2.14 (#466)
Bumps [rack](https://github.com/rack/rack) from 2.2.10 to 2.2.14.
- [Release notes](https://github.com/rack/rack/releases)
- [Changelog](https://github.com/rack/rack/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rack/rack/compare/v2.2.10...v2.2.14)
---
updated-dependencies:
- dependency-name: rack
dependency-version: 2.2.14
dependency-type: indirect
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
Gemfile.lock | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Gemfile.lock b/Gemfile.lock
index 28262ed0..1366861a 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -308,7 +308,7 @@ GEM
puma (6.4.3)
nio4r (~> 2.0)
racc (1.8.1)
- rack (2.2.10)
+ rack (2.2.14)
rack-test (2.1.0)
rack (>= 1.3)
rails (6.1.7.10)
From e006d7407d8750c802b716c3565dba166e0a6fa3 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 9 May 2025 08:34:20 +0200
Subject: [PATCH 157/159] Bump net-imap from 0.4.17 to 0.4.20 (#465)
Bumps [net-imap](https://github.com/ruby/net-imap) from 0.4.17 to 0.4.20.
- [Release notes](https://github.com/ruby/net-imap/releases)
- [Commits](https://github.com/ruby/net-imap/compare/v0.4.17...v0.4.20)
---
updated-dependencies:
- dependency-name: net-imap
dependency-version: 0.4.20
dependency-type: indirect
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
Gemfile.lock | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Gemfile.lock b/Gemfile.lock
index 1366861a..8e0017cf 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -140,7 +140,7 @@ GEM
cucumber-tag_expressions (1.1.1)
cucumber-wire (0.0.1)
database_cleaner (1.8.5)
- date (3.4.0)
+ date (3.4.1)
demoji (0.0.7)
devise (4.7.3)
bcrypt (~> 3.0)
@@ -252,7 +252,7 @@ GEM
multi_xml (0.6.0)
multipart-post (2.1.1)
mysql2 (0.5.5)
- net-imap (0.4.17)
+ net-imap (0.4.20)
date
net-protocol
net-pop (0.1.2)
@@ -448,7 +448,7 @@ GEM
temple (0.8.2)
thor (1.3.2)
tilt (2.0.10)
- timeout (0.4.1)
+ timeout (0.4.3)
turbolinks (5.2.1)
turbolinks-source (~> 5.2)
turbolinks-source (5.2.0)
From d2edf2cb65f09f9062c1afe631c29e69cb7acd81 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 9 May 2025 14:09:15 +0200
Subject: [PATCH 158/159] Bump nokogiri from 1.16.8 to 1.18.8 (#464)
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.16.8 to 1.18.8.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.16.8...v1.18.8)
---
updated-dependencies:
- dependency-name: nokogiri
dependency-version: 1.18.8
dependency-type: indirect
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
Gemfile.lock | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Gemfile.lock b/Gemfile.lock
index 8e0017cf..fb5ef679 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -266,9 +266,9 @@ GEM
net-ssh (6.1.0)
netrc (0.11.0)
nio4r (2.7.4)
- nokogiri (1.16.8-arm64-darwin)
+ nokogiri (1.18.8-arm64-darwin)
racc (~> 1.4)
- nokogiri (1.16.8-x86_64-linux)
+ nokogiri (1.18.8-x86_64-linux-gnu)
racc (~> 1.4)
oauth2 (1.4.4)
faraday (>= 0.8, < 2.0)
From ab2b1b3b78eb11021bf3cf48368b7e5cce8db183 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 15 Aug 2025 10:44:42 +0200
Subject: [PATCH 159/159] Bump nokogiri from 1.18.8 to 1.18.9 (#470)
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.18.8 to 1.18.9.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.18.8...v1.18.9)
---
updated-dependencies:
- dependency-name: nokogiri
dependency-version: 1.18.9
dependency-type: indirect
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
Gemfile.lock | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Gemfile.lock b/Gemfile.lock
index fb5ef679..518d1539 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -266,9 +266,9 @@ GEM
net-ssh (6.1.0)
netrc (0.11.0)
nio4r (2.7.4)
- nokogiri (1.18.8-arm64-darwin)
+ nokogiri (1.18.9-arm64-darwin)
racc (~> 1.4)
- nokogiri (1.18.8-x86_64-linux-gnu)
+ nokogiri (1.18.9-x86_64-linux-gnu)
racc (~> 1.4)
oauth2 (1.4.4)
faraday (>= 0.8, < 2.0)